diff --git a/cmd/mapstructure-to-hcl2/mapstructure-to-hcl2.go b/cmd/mapstructure-to-hcl2/mapstructure-to-hcl2.go index 5fce0daaf..da3a507bf 100644 --- a/cmd/mapstructure-to-hcl2/mapstructure-to-hcl2.go +++ b/cmd/mapstructure-to-hcl2/mapstructure-to-hcl2.go @@ -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 {