Skip to content

Commit

Permalink
Check if default value is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
onrik committed Oct 21, 2022
1 parent cde59a6 commit df6ce6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion default.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func setDefaultValue(v reflect.Value) error {
}
if strings.HasPrefix(tag, "default") {
parts := strings.SplitN(tag, "=", 2)
if len(parts) < 2 {
if len(parts) < 2 || parts[1] == "" {
continue
}
defaultValue := parts[1]
Expand Down

0 comments on commit df6ce6c

Please sign in to comment.