when using a slice of an imported field type, the Underlying still returned the slice rather than the element type.

pull/8268/head
Megan Marsh 7 years ago
parent 8d8bd3f891
commit da53ac99be

@ -343,7 +343,7 @@ func getUsedImports(s *types.Struct) map[NamePath]*types.Package {
fieldType = p.Elem()
}
if p, ok := fieldType.(*types.Slice); ok {
fieldType = p.Underlying()
fieldType = p.Elem()
}
namedType, ok := fieldType.(*types.Named)
if !ok {

Loading…
Cancel
Save