Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
clayne11 committed Sep 18, 2024
1 parent b41ae1a commit 0508cef
Show file tree
Hide file tree
Showing 8 changed files with 526 additions and 1,631 deletions.
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ issues:
- path: codegen/testserver/.*/resolver\.go
linters:
- gocritic
# The interfaces are autogenerated and don't conform to the paramTypeCombine rule
- path: _examples/federation/products/graph/entity.resolvers.go
linters:
- gocritic
# Disable revive.use-any for backwards compatibility
- path: graphql/map.go
text: "use-any: since GO 1.18 'interface{}' can be replaced by 'any'"
Expand Down
48 changes: 18 additions & 30 deletions _examples/federation/reviews/graph/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _examples/federation/reviews/graph/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

type Resolver struct{}

func (r *entityResolver) FindProductByManufacturerIDAndID(ctx context.Context, manufacturerID string, id string) (*model.Product, error) {
func (r *entityResolver) FindProductByManufacturerIDAndID(ctx context.Context, manufacturerID, id string) (*model.Product, error) {
var productReviews []*model.Review

for _, review := range reviews {
Expand Down
2 changes: 1 addition & 1 deletion plugin/federation/federation.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ func (f *Federation) generateExplicitRequires(
func buildResolverSDL(
resolver *EntityResolver,
multi bool,
) (resolverSDL string, entityResolverInputSDL string) {
) (resolverSDL, entityResolverInputSDL string) {
if multi {
entityResolverInputSDL = buildEntityResolverInputDefinitionSDL(resolver)
resolverSDL := fmt.Sprintf("\t%s(reps: [%s]!): [%s]", resolver.ResolverName, resolver.InputTypeName, resolver.ReturnTypeName)
Expand Down
10 changes: 5 additions & 5 deletions plugin/federation/federation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestNew(t *testing.T) {
},
}
plugin, err := New(1, cfg)
assert.NoError(t, err)
require.NoError(t, err)
assert.NotNil(t, plugin)
})

Expand All @@ -36,7 +36,7 @@ func TestNew(t *testing.T) {
CallArgumentDirectivesWithNull: true,
}
plugin, err := New(1, cfg)
assert.NoError(t, err)
require.NoError(t, err)
assert.NotNil(t, plugin)
})

Expand All @@ -51,7 +51,7 @@ func TestNew(t *testing.T) {
CallArgumentDirectivesWithNull: true,
}
plugin, err := New(1, cfg)
assert.Error(t, err)
require.Error(t, err)
assert.Nil(t, plugin)
})

Expand All @@ -66,7 +66,7 @@ func TestNew(t *testing.T) {
CallArgumentDirectivesWithNull: false,
}
plugin, err := New(1, cfg)
assert.Error(t, err)
require.Error(t, err)
assert.Nil(t, plugin)
})

Expand All @@ -82,7 +82,7 @@ func TestNew(t *testing.T) {
}

plugin, err := New(1, cfg)
assert.Error(t, err)
require.Error(t, err)
assert.Nil(t, plugin)
})
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0508cef

Please sign in to comment.