Skip to content

Commit

Permalink
[TT-5460] Fixed gosimple complaint
Browse files Browse the repository at this point in the history
[changelog]
internal: Removed explicit length for empty map.
  • Loading branch information
David Stutt committed May 30, 2022
1 parent c0ac6e5 commit 163b185
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/federation/sdlmerge/collect_valid_entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func newCollectValidEntitiesVisitor(n *normalizer) *collectValidEntitiesVisitor

func (c *collectValidEntitiesVisitor) Register(walker *astvisitor.Walker) {
c.Walker = walker
c.normalizer.entities = make(map[string]map[string]bool, 0)
c.normalizer.entities = make(map[string]map[string]bool)
walker.RegisterEnterDocumentVisitor(c)
walker.RegisterEnterInterfaceTypeDefinitionVisitor(c)
walker.RegisterEnterObjectTypeDefinitionVisitor(c)
Expand Down Expand Up @@ -73,7 +73,7 @@ func (c *collectValidEntitiesVisitor) EnterObjectTypeDefinition(ref int) {
}

func (c *collectValidEntitiesVisitor) getPrimaryKeys(name string, directiveRefs []int) map[string]bool {
primaryKeys := make(map[string]bool, 0)
primaryKeys := make(map[string]bool)
for _, directiveRef := range directiveRefs {
if c.document.DirectiveNameString(directiveRef) != "key" {
continue
Expand Down
2 changes: 1 addition & 1 deletion pkg/federation/sdlmerge/sdlmerge.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ type PotentialEntityType interface {
func getPrimaryKeys(p PotentialEntityType, n *normalizer, name string, directiveRefs []int) map[string]bool {
baseKeys := n.entities[name]
document := p.getDocument()
primaryKeys := make(map[string]bool, 0)
primaryKeys := make(map[string]bool)
for _, directiveRef := range directiveRefs {
if document.DirectiveNameString(directiveRef) != "key" {
continue
Expand Down

0 comments on commit 163b185

Please sign in to comment.