15 lines
232 B
Go
15 lines
232 B
Go
package domain
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
func validateNotBlank(field, value string) error {
|
|
if strings.TrimSpace(value) == "" {
|
|
return fmt.Errorf("%s consists of whitespace only: %w", field, ErrValidation)
|
|
}
|
|
|
|
return nil
|
|
}
|