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

Add WrapIfUnwrapped and other Lint fixes #275

Merged
merged 2 commits into from
Sep 7, 2023
Merged

Conversation

StevenACoffman
Copy link
Collaborator

@StevenACoffman StevenACoffman commented Sep 7, 2023

In reviewing other PRs, I noticed some linter suggestions.

One of them was that we didn't wrap errors from external packages here:

schema.go:17:15: error returned from external package is unwrapped: sig: func github.com/vektah/gqlparser/v2/parser.ParseSchemas(inputs ...*github.com/vektah/gqlparser/v2/ast.Source) (*github.com/vektah/gqlparser/v2/ast.SchemaDocument, error)

It was tedious to look through all the possible error originations to see if they could be wrapped so I added a convenience "WrapIfUnwrapped" and just called that.

There were some other linter issues where we reused package names as variable names such that it was a bit confusing, so I renamed those.

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

Signed-off-by: Steve Coffman <steve@khanacademy.org>
Signed-off-by: Steve Coffman <steve@khanacademy.org>
@StevenACoffman StevenACoffman changed the title Add WrapIfUnwrapped Add WrapIfUnwrapped and other Lint fixes Sep 7, 2023
@StevenACoffman StevenACoffman merged commit 450a0ee into master Sep 7, 2023
5 checks passed
@StevenACoffman StevenACoffman deleted the WrapIfUnwrapped branch September 7, 2023 12:54
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.

None yet

1 participant