1
0
mirror of https://github.com/chylex/SMTP-Relay.git synced 2024-10-16 23:42:47 +02:00
SMTP-Relay/internal/smtp/utils.go

22 lines
373 B
Go

package smtp
import (
"github.com/google/uuid"
"github.com/sirupsen/logrus"
)
func containsKey[K comparable, V any](m map[K]V, key K) bool {
_, ok := m[key]
return ok
}
func generateUUID(log *logrus.Logger) string {
id, err := uuid.NewRandom()
if err != nil {
log.WithError(err).Error("could not generate UUIDv4")
return ""
} else {
return id.String()
}
}