move comment about empty-value of Arrays to the code path the array case takes

This commit is contained in:
Nicolas S. Dade
2016-09-23 17:24:21 -07:00
parent 32cc087149
commit 4b3499f325
+2 -1
View File
@@ -214,7 +214,7 @@ func (g *Generator) notEmptyCheck(t reflect.Type, v string) string {
}
switch t.Kind() {
case reflect.Slice, reflect.Map: // note: Array types don't have a useful empty value
case reflect.Slice, reflect.Map:
return "len(" + v + ") != 0"
case reflect.Interface, reflect.Ptr:
return v + " != nil"
@@ -229,6 +229,7 @@ func (g *Generator) notEmptyCheck(t reflect.Type, v string) string {
return v + " != 0"
default:
// note: Array types don't have a useful empty value
return "true"
}
}