From 6e12ea5734446d5081da6d3fc45937815c71900e Mon Sep 17 00:00:00 2001 From: Denis Isaev Date: Tue, 12 Jun 2018 10:07:10 +0300 Subject: [PATCH] docs: add FAQ entry about go install --- Makefile | 2 +- README.md | 7 ++++++- README.md.tmpl | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 50d7e571..f168813f 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index 49416b19..c27c6087 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/README.md.tmpl b/README.md.tmpl index 8c2e3109..0c081685 100644 --- a/README.md.tmpl +++ b/README.md.tmpl @@ -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.