Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix redundant type warning #1163

Merged
merged 2 commits into from
May 12, 2020
Merged

fix redundant type warning #1163

merged 2 commits into from
May 12, 2020

Conversation

fwojciec
Copy link
Contributor

The most recent versions of gopls report explicit type definitions on individual slice/array/map items as a warning:

redundant type from array, slice, or map composite literal

Screen Shot 2020-04-22 at 12 12 56

I believe this is because of the inclusion of https://golang.org/cmd/gofmt/#hdr-The_simplify_command in the checks performed by the lsp.

The PR makes a small modification to codegen/generated!.gotpl template to prevent this warning from showing up in the code generated by gqlgen.

I have:

  • Added tests covering the bug / feature (see testing)

It's effectively a code-formatting change and it doesn't affect any functionality.

  • Updated any relevant documentation (see docs)

It's effectively a code-formatting change and it doesn't affect any functionality.

@andygrunwald
Copy link

To reproduce:
Running gofmt in simplify mode (gofmt -d -s .).

gofmt -d doesnt raise this piece.

@mtibben
Copy link
Member

mtibben commented May 12, 2020

Seems reasonable

@mtibben mtibben merged commit 40570d1 into 99designs:master May 12, 2020
cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
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