1
0
Fork 0

Insensitive case for allow-empty value.

This commit is contained in:
Ludovic Fernandez 2019-04-09 16:50:06 +02:00 committed by Traefiker Bot
parent 2e20394af4
commit ee0e014617
2 changed files with 28 additions and 1 deletions

View file

@ -52,7 +52,7 @@ func addMetadata(rootType reflect.Type, node *Node) error {
return fmt.Errorf("node %s (type %s) must have children", node.Name, fType)
}
node.Disabled = len(node.Value) > 0 && node.Value != "true" && field.Tag.Get(TagLabel) == "allowEmpty"
node.Disabled = len(node.Value) > 0 && !strings.EqualFold(node.Value, "true") && field.Tag.Get(TagLabel) == "allowEmpty"
}
if len(node.Children) == 0 {