William Petit
e66938f1d3
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
15 lines
257 B
Go
15 lines
257 B
Go
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
|
|
}
|