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

Prefer any over interface{} #3438

Merged
merged 4 commits into from
Dec 20, 2024
Merged

Prefer any over interface{} #3438

merged 4 commits into from
Dec 20, 2024

Conversation

StevenACoffman
Copy link
Collaborator

@StevenACoffman StevenACoffman commented Dec 15, 2024

This just replaces interface{} with any. This may help with #3414

Signed-off-by: Steve Coffman steve@khanacademy.org

@StevenACoffman StevenACoffman changed the title enable testifylint.encoded-compare and fix lint issues (#3434) Prefer any over interface{} Dec 15, 2024
@StevenACoffman StevenACoffman added the help wanted Extra attention is needed label Dec 18, 2024
Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
@StevenACoffman
Copy link
Collaborator Author

@Brookke hey, after I rebased this with your PR, I'm getting this modelgen error. May be unrelated to your change, but if you get a chance to take a look, I would appreciate it.

@StevenACoffman
Copy link
Collaborator Author

@evellior Rather than figure out what was causing the inconsistency (sometimes generate with interface{} and sometimes with any), I tried to just switch everything to any. However, it looks like there's a problem with the modelgen:

Generated github.com/99designs/gqlgen/codegen/testserver/compliant-int/generated-default in 0.61s
Generated github.com/99designs/gqlgen/codegen/testserver/compliant-int/generated-compliant-strict in 0.48s
modelgen: package cannot be nil
exit status 3
codegen/testserver/followschema/generated_test.go:2: running "go": exit status 1
Generated github.com/99designs/gqlgen/codegen/testserver/nullabledirectives/generated in 0.81s
modelgen: package cannot be nil
exit status 3
codegen/testserver/singlefile/generated_test.go:2: running "go": exit status 1

After my day job, I'll try to take a look at it some more, but if anything jumps out at you as the cause, I would appreciate some extra eyes.

Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
@StevenACoffman StevenACoffman merged commit c17abcc into master Dec 20, 2024
17 checks passed
@StevenACoffman StevenACoffman deleted the any_over_interface branch December 20, 2024 01:08
@StevenACoffman
Copy link
Collaborator Author

So I am a doofus. :) any is just a type alias for interface{}, so when you are making a conditional based on the type, you still need to look for interface{} rather than any. This was a self-inflicted brain injury on my part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant