This commit updates the configuration to be yaml-based and updates the configuration to read in a yaml file.
16 lines
248 B
Go
16 lines
248 B
Go
package validators
|
|
|
|
import "github.com/pkg/errors"
|
|
|
|
var errEmpty = errors.New("value is empty")
|
|
|
|
func ValidateNonempty(value *string, dflt string) error {
|
|
if *value == "" {
|
|
*value = dflt
|
|
}
|
|
|
|
if *value == "" {
|
|
return errEmpty
|
|
}
|
|
return nil
|
|
}
|