Skip to content

Comments

[Refactor] Fix linter error in dumper.go & path.go#416

Merged
StevenACoffman merged 2 commits intovektah:masterfrom
fredzqm:master
Feb 19, 2026
Merged

[Refactor] Fix linter error in dumper.go & path.go#416
StevenACoffman merged 2 commits intovektah:masterfrom
fredzqm:master

Conversation

@fredzqm
Copy link
Contributor

@fredzqm fredzqm commented Feb 17, 2026

This PR has no behavior change. Hence, no tests change.

It makes the behavior of isZero for boolean field explicit and address the linter warnings in a good way.

Previously, we got this linter error in master commit's CI result

$ golangci-lint run  ast/dumper.go --fix
ast/dumper.go:153:9: reflectvaluecompare: avoid using reflect.DeepEqual with reflect.Value (govet)
        return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()))
               ^
1 issues:
* govet: 1

Fixed another linter error that pops up after the prev issue is fixed:

run golangci-lint
  Running [/home/runner/golangci-lint-2.10.1-linux-amd64/golangci-lint config path] in [/home/runner/work/gqlparser/gqlparser] ...
  Running [/home/runner/golangci-lint-2.10.1-linux-amd64/golangci-lint config verify] in [/home/runner/work/gqlparser/gqlparser] ...
  Running [/home/runner/golangci-lint-2.10.1-linux-amd64/golangci-lint run  --timeout 5m] in [/home/runner/work/gqlparser/gqlparser] ...
  Error: ast/path.go:30:4: QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) (staticcheck)
  			str.WriteString(fmt.Sprintf("[%d]", v))
  			^
  1 issues:
  * staticcheck: 1
  
  Error: issues found
  Ran golangci-lint in 20872ms

I have:

  • Added tests covering the bug / feature
  • Updated any relevant documentation

@coveralls
Copy link

coveralls commented Feb 17, 2026

Coverage Status

coverage: 87.157% (-0.02%) from 87.18%
when pulling 9caeee1 on fredzqm:master
into 48a3d5e on vektah:master.

@fredzqm fredzqm changed the title [Refactor] Fix linter in isZero [Refactor] Fix linter error in dumper.go & path.go Feb 17, 2026
@StevenACoffman StevenACoffman merged commit c6fdeec into vektah:master Feb 19, 2026
6 checks passed
@StevenACoffman
Copy link
Collaborator

Thanks so much! I really appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants