Skip to content

Commit

Permalink
fix: ensure no duplicate ResourceName symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwenn committed Apr 28, 2021
1 parent cb7fad9 commit 069e026
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/plugin/resourcename/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ func GeneratePackage(
pkg := path.Dir(resources[0].ParentFile)

// keep track of what resource names have been generated in the package
seen := make(map[aipreflect.ResourceTypeName]struct{})
seen := make(map[string]struct{})
queue := resources

for len(queue) > 0 {
resource := queue[0]
queue = queue[1:]

if _, ok := seen[resource.Type]; ok {
if _, ok := seen[resource.Type.Type()]; ok {
continue
}
seen[resource.Type] = struct{}{}
seen[resource.Type.Type()] = struct{}{}

// no support for multiple resource name definitions
name := resource.Names[0]
Expand Down

0 comments on commit 069e026

Please sign in to comment.