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

Correct Example syntax triggering "block should not end with a whitespace (or comment)" #38

Closed
hairyhenderson opened this issue Oct 14, 2019 · 5 comments · Fixed by #39

Comments

@hairyhenderson
Copy link
Contributor

Example functions must end with comments, but wsl doesn't like that very much:

Here's a snippet that's failing for me in go-which:

func ExampleWhich() {
        path := Which("sh")
        fmt.Printf("Found sh at: %s", path)

        // Output: Found sh at: /bin/sh
}
$ wsl which_test.go 
which_test.go:124: block should not end with a whitespace (or comment)

I'm thinking wsl should probably ignore this particular check in Example tests.

@hairyhenderson
Copy link
Contributor Author

Another thing to note: I'm using golangci-lint to run wsl, and so I could add // nolint: wsl to ignore these failures. However, that comment then gets put into the godoc:

Screen Shot 2019-10-14 at 10 50 38

@bombsimon
Copy link
Owner

Thank you for this report! I'll look into this asap!

@hairyhenderson
Copy link
Contributor Author

@bombsimon I hacked up a fix which I'll PR soon, though it's a bit messy 😉

@hairyhenderson
Copy link
Contributor Author

See #39 for a potential fix

@bombsimon
Copy link
Owner

Looks good! Thank you so much for the report and the PR! Merged and I'll try to include it in an existing PR to update golangci-lint!

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 a pull request may close this issue.

2 participants