File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 66 "reflect"
77 "sort"
88 "sync"
9+ "time"
910)
1011
1112// A field represents a single field found in a struct.
@@ -131,7 +132,7 @@ func typeFields(t reflect.Type) []field {
131132 }
132133
133134 // Record found field and index sequence.
134- if name != "" || ! sf .Anonymous || ft .Kind () != reflect .Struct {
135+ if name != "" || ! sf .Anonymous || ft .Kind () != reflect .Struct || isPseudoType ( ft ) {
135136 tagged := name != ""
136137 if name == "" {
137138 name = sf .Name
@@ -200,6 +201,10 @@ func typeFields(t reflect.Type) []field {
200201 return fields
201202}
202203
204+ func isPseudoType (t reflect.Type ) bool {
205+ return t == reflect .TypeOf (time.Time {})
206+ }
207+
203208// dominantField looks through the fields, all of which are known to
204209// have the same name, to find the single field that dominates the
205210// others using Go's embedding rules, modified by the presence of
You can’t perform that action at this time.
0 commit comments