wisski-cloud-distillery/internal/config/validators/string.go
Tom Wiesing 945329a080
Move to yaml-based configuration
This commit updates the configuration to be yaml-based and updates the
configuration to read in a yaml file.
2023-02-25 09:14:56 +01:00

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
}