Merge pull request #8268 from hashicorp/fix_hcl2_mapstructure_code

when using a slice of an imported field type, the Underlying still re…
This commit is contained in:
Megan Marsh 2019-10-24 11:50:18 -07:00 committed by GitHub
commit 2274f54ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()
}
if p, ok := fieldType.(*types.Slice); ok {
fieldType = p.Underlying()
fieldType = p.Elem()
}
namedType, ok := fieldType.(*types.Named)
if !ok {