docs: add FAQ entry about go install

This commit is contained in:
Denis Isaev 2018-06-12 10:07:10 +03:00
parent 1ff1d6733f
commit 6e12ea5734
No known key found for this signature in database
GPG Key ID: A36A0EC8E27A1A01
3 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,5 @@
test:
go install ./cmd/...
go install -i ./cmd/... # needed for govet and golint
golangci-lint run -v
golangci-lint run --fast --no-config -v
golangci-lint run --no-config -v

View File

@ -255,7 +255,7 @@ Flags:
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
# golint: Annoying issue about not having a comment. The rare codebase has such comments
- (comment on exported (method|function)|should have( a package)? comment|comment should be of the form)
- (comment on exported (method|function|type)|should have( a package)? comment|comment should be of the form)
# golint: False positive when tests are defined in package 'test'
- func name will be used as test\.Test.* by other packages, and that stutters; consider calling this
@ -403,6 +403,11 @@ go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`
```
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
**Q: `govet` or `golint` reports false-positives or false-negatives**
These linters obtain type information from installed package files.
The same issue you will encounter if will run `govet` or `golint` without `golangci-lint`.
Try `go install -i ./...` (or `go install -i ./cmd/...`: depends on the project) first.
**Q: `golangci-lint` doesn't work**
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
2. Run it with `-v` option and check the output.

View File

@ -275,6 +275,11 @@ go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`
```
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
**Q: `govet` or `golint` reports false-positives or false-negatives**
These linters obtain type information from installed package files.
The same issue you will encounter if will run `govet` or `golint` without `golangci-lint`.
Try `go install -i ./...` (or `go install -i ./cmd/...`: depends on the project) first.
**Q: `golangci-lint` doesn't work**
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
2. Run it with `-v` option and check the output.