shurcooL / graphql

Package graphql provides a GraphQL client implementation.
MIT License
708 stars 282 forks source link

Optimize hasGraphQLName and isGraphQLFragment #111

Open alexandear opened 1 year ago

alexandear commented 1 year ago

The PR refactors hasGraphQLName and isGraphQLFragment internal functions to accept parameters which are really used.

This was found by running gocritic linter:

gocritic check -enableAll ./...

./internal/jsonutil/graphql.go:271:21: hugeParam: f is heavy (97 bytes); consider passing it by pointer
./internal/jsonutil/graphql.go:292:24: hugeParam: f is heavy (97 bytes); consider passing it by pointer