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 errorlint violations and re-enable it #333

Open
bom-d-van opened this issue Jun 7, 2021 · 0 comments
Open

Fix errorlint violations and re-enable it #333

bom-d-van opened this issue Jun 7, 2021 · 0 comments
Assignees

Comments

@bom-d-van
Copy link
Collaborator

When I upgraded golangci-lint to version v1.40.1 in this PR, there are many errorlint issues reported. As they are not introduced by my changes. I decided to temporarily disable errorlint and filed a ticket here as reference.

$ golangci-lint run
WARN [runner] The linter 'scopelint' is deprecated (since v1.39.0) due to: The repository of the linter has been deprecated by the owner.  Replaced by exportloopref.
expr/functions/cairo/png/pixel_ratio.go:75:12: cannot use &(pixelRatioContext literal) (value of type *pixelRatioContext) as cairoContext value in struct literal: missing method AppendPath (typecheck)
		context: &pixelRatioContext{
		         ^
app/carbonzipper/http_handlers.go:638:16: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
			if _, ok := e.(types.ErrNotFound); !ok {
			            ^
cache/cache.go:99:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
		if err == memcache.ErrCacheMiss {
		   ^
cache/cache.go:217:6: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
		if err == memcache.ErrCacheMiss {
		   ^
cache/cache_test.go:68:5: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
	if err != ErrNotFound {
	   ^
cache/cache_test.go:96:5: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
	if err != ErrTimeout {
	   ^
expr/functions/aliasSub/function.go:50:79: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
		return nil, fmt.Errorf("%w: %s %v", parser.ErrInvalidArgumentValue, search, err)
		                                                                            ^
expr/functions/exclude/function.go:46:76: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
		return nil, fmt.Errorf("%w: %s %v", parser.ErrInvalidArgumentValue, pat, err)
		                                                                         ^
expr/functions/grep/function.go:46:76: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
		return nil, fmt.Errorf("%w: %s %v", parser.ErrInvalidArgumentValue, pat, err)
		                                                                         ^
expr/helper/helper.go:63:20: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
		if err != nil && err != parser.ErrSeriesDoesNotExist {
		                 ^
pkg/backend/net/net.go:297:18: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
		if code, ok := err.(ErrHTTPCode); ok && code == http.StatusNotFound {
		               ^
@grzkv grzkv self-assigned this Sep 29, 2022
@grzkv grzkv added this to the Release v0.5.0 milestone Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants