Skip to content

Commit

Permalink
Use map[string]struct{}{} instead for HashSet
Browse files Browse the repository at this point in the history
  • Loading branch information
shuheiktgw committed Dec 21, 2021
1 parent 49c4daa commit 3d86460
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ func (tl *TypeLoader) LoadColumns(args *ArgType, typeTpl *Type) error {

// validate custom type columns
if columnTypes != nil {
columnSet := map[string]bool{}
columnSet := map[string]struct{}{}
for _, column := range columnList {
columnSet[column.ColumnName] = true
columnSet[column.ColumnName] = struct{}{}
}

for k, _ := range columnTypes {
Expand Down
4 changes: 2 additions & 2 deletions v2/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ func (tl *TypeLoader) LoadColumns(typeTpl *models.Type) error {

// validate custom type columns
if columnTypes != nil {
columnSet := map[string]bool{}
columnSet := map[string]struct{}{}
for _, column := range columnList {
columnSet[column.ColumnName] = true
columnSet[column.ColumnName] = struct{}{}
}

for k, _ := range columnTypes {
Expand Down

0 comments on commit 3d86460

Please sign in to comment.