Skip to content

Commit 6e12ea5

Browse files
committed
docs: add FAQ entry about go install
1 parent 1ff1d67 commit 6e12ea5

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test:
2-
go install ./cmd/...
2+
go install -i ./cmd/... # needed for govet and golint
33
golangci-lint run -v
44
golangci-lint run --fast --no-config -v
55
golangci-lint run --no-config -v

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ Flags:
255255
- Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
256256
257257
# golint: Annoying issue about not having a comment. The rare codebase has such comments
258-
- (comment on exported (method|function)|should have( a package)? comment|comment should be of the form)
258+
- (comment on exported (method|function|type)|should have( a package)? comment|comment should be of the form)
259259
260260
# golint: False positive when tests are defined in package 'test'
261261
- 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/`
403403
```
404404
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
405405

406+
**Q: `govet` or `golint` reports false-positives or false-negatives**
407+
These linters obtain type information from installed package files.
408+
The same issue you will encounter if will run `govet` or `golint` without `golangci-lint`.
409+
Try `go install -i ./...` (or `go install -i ./cmd/...`: depends on the project) first.
410+
406411
**Q: `golangci-lint` doesn't work**
407412
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
408413
2. Run it with `-v` option and check the output.

README.md.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`
275275
```
276276
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
277277

278+
**Q: `govet` or `golint` reports false-positives or false-negatives**
279+
These linters obtain type information from installed package files.
280+
The same issue you will encounter if will run `govet` or `golint` without `golangci-lint`.
281+
Try `go install -i ./...` (or `go install -i ./cmd/...`: depends on the project) first.
282+
278283
**Q: `golangci-lint` doesn't work**
279284
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`
280285
2. Run it with `-v` option and check the output.

0 commit comments

Comments
 (0)