Implement code review feedback

This commit is contained in:
Joe Schmitt
2021-02-24 14:13:11 -05:00
committed by Alec Thomas
parent 454f2c067e
commit ed24960916
3 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ func parseTag(fv reflect.Value, ft reflect.StructField) *Tag {
t.Prefix = t.Get("prefix")
t.Embed = t.Has("embed")
negatable := t.Has("negatable")
if negatable && ft.Type.Name() != "bool" {
if negatable && ft.Type.Kind() != reflect.Bool {
fail("negatable can only be set on booleans")
}
t.Negatable = negatable