entc/gen: add support for ValueScanner for bytes type (#524)

This commit is contained in:
Ariel Mashraki
2020-06-04 19:00:07 +03:00
committed by GitHub
parent a43ceb1595
commit 29688a0fa5
9 changed files with 273 additions and 4 deletions

View File

@@ -822,6 +822,10 @@ func (f Field) BasicType(ident string) (expr string) {
case rt.TypeEqual(nullBoolType):
expr = fmt.Sprintf("%s.Bool", ident)
}
case field.TypeBytes:
if rt.Kind == reflect.Slice {
expr = fmt.Sprintf("[]byte(%s)", ident)
}
case field.TypeTime:
switch {
case rt.Kind == reflect.Bool: