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

Enable wastedassign, whitespace linters; fix issues #1665

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Nov 17, 2023

This PR enables wastedassign and whitespace linters. And fixes the following issues:

❯ golangci-lint run
server.go:2294: unnecessary leading newline (whitespace)
                if ctx.Request.MayContinue() {

tcpdialer.go:378: unnecessary trailing newline (whitespace)

        }
server_test.go:1922: unnecessary leading newline (whitespace)
        for i := 0; i < 25; i++ {

args.go:554:2: assigned to idx, but reassigned without using the value (wastedassign)
        idx := 0
        ^
server.go:1849:3: assigned to c, but reassigned without using the value (wastedassign)
                c = nil
                ^
server.go:2587:2: assigned to ctx, but reassigned without using the value (wastedassign)
        ctx = nil
        ^
workerpool.go:113:8: assigned to mid, but reassigned without using the value (wastedassign)
        l, r, mid := 0, n-1, 0
              ^
workerpool.go:241:3: assigned to c, but reassigned without using the value (wastedassign)
                c = nil
                ^
streaming_test.go:34:4: assigned to body, but reassigned without using the value (wastedassign)
                        body := ""
                        ^

@erikdubbelboer erikdubbelboer merged commit d3397c6 into valyala:master Nov 24, 2023
13 of 14 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks! I like it!

@alexandear alexandear deleted the fix-wastedassign-whitespace-lint-issues branch November 24, 2023 12:58
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

2 participants