Re: [go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-07 Thread Marcello H
The point I was making is not simply to ignore a linter outcome, but add the reason behind it. It might be a bad comment in your opinion, but that was not the point. Op di 7 mrt 2023 om 18:42 schreef Kurtis Rader : > On Mon, Mar 6, 2023 at 10:38 PM Marcello H wrote: > >> What I do (and is a

Re: [go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-07 Thread Kurtis Rader
On Mon, Mar 6, 2023 at 10:38 PM Marcello H wrote: > What I do (and is a good practice), is adding behind the comment more info. > > //nolint:errcheck // no need to test it, because it was tested before with > stat I appreciate that you're replying to what I hope is just a bad example but

Re: [go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-06 Thread Marcello H
What I do (and is a good practice), is adding behind the comment more info. //nolint:errcheck // no need to test it, because it was tested before with stat Op maandag 6 maart 2023 om 23:05:42 UTC+1 schreef Steven Hartland: > I would use the following if I truly wanted to ignore an error, but I

Re: [go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-06 Thread Steven Hartland
I would use the following if I truly wanted to ignore an error, but I would question if ignoring the error from os.Open was ever a good idea. If you want to handle a file not found error then do so, don't just ignore the error. file, _ := os.Open(name) //nolint: errcheck On Mon, 6 Mar 2023 at

[go-nuts] Best way to mark unused parameters/error values reported by linter

2023-03-06 Thread Sergei Dyshel
Hello all, I'm incorporating golangci-lint linter aggregator in my codebase and facing a dilemma on how to mark false positives for these 2 linters: - errcheck - reports unchecked errors. - unparam - reports unused function parameters. The