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

This commit is contained in:
Megan Marsh 2019-10-23 15:08:14 -07:00
parent 8d8bd3f891
commit da53ac99be
1 changed files with 1 additions and 1 deletions

View File

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