bouncer/internal/store/name.go

15 lines
257 B
Go
Raw Normal View History

2023-04-24 20:52:12 +02:00
package store
import "github.com/pkg/errors"
type Name string
var ErrEmptyName = errors.New("name cannot be empty")
func ValidateName(name string) (Name, error) {
if name == "" {
return "", errors.WithStack(ErrEmptyName)
}
return Name(name), nil
}