added correct link and example for nolint comment directive

Signed-off-by: Arshpreet <7arshpreet@gmail.com>
This commit is contained in:
Arshpreet 2019-12-23 21:09:53 +05:30
parent 227a953e93
commit 4f77171270

View file

@ -1,6 +1,6 @@
# Code Style # Code Style
We follow the standard Go style using gofmt, but with a few extra We follow the standard Go style using goimports, but with a few extra
considerations. considerations.
## Linters ## Linters
@ -9,8 +9,8 @@ We use `golangci-lint` to run a number of linters, the exact list can be found u
in [.golangci.yml](.golangci.yml). [Installation](https://github.com/golangci/golangci-lint#install) and [Editor Integration](https://github.com/golangci/golangci-lint#editor-integration) for it can be found in the readme of golangci-lint. in [.golangci.yml](.golangci.yml). [Installation](https://github.com/golangci/golangci-lint#install) and [Editor Integration](https://github.com/golangci/golangci-lint#editor-integration) for it can be found in the readme of golangci-lint.
For rare cases where a linter is giving a spurious warning, it can be disabled For rare cases where a linter is giving a spurious warning, it can be disabled
for that line or statement using a [comment directive](https://github.com/alecthomas/gometalinter#comment-directives), e.g. for that line or statement using a [comment directive](https://github.com/golangci/golangci-lint#nolint), e.g.
`// nolint: gocyclo`. This should be used sparingly and only when its clear `var bad_name int //nolint:golint,unused`. This should be used sparingly and only when its clear
that the lint warning is spurious. that the lint warning is spurious.
The linters can be run using [scripts/find-lint.sh](scripts/find-lint.sh) The linters can be run using [scripts/find-lint.sh](scripts/find-lint.sh)