Skip to content

Commit 7d224b1

Browse files
author
golangci
authored
Merge pull request #24 from y0ssar1an/master
Improve FAQ instructions for vendoring golangci-lint
2 parents 0f2e366 + aa68ffb commit 7d224b1

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,24 @@ By doing this you won't create new issues in code and can smoothly fix existing
366366

367367
A: You have 2 choices:
368368
1. Use [GolangCI](https://golangci.com): this service is highly integrated with GitHub (issues are commented in the pull request) and uses a `golangci-lint` tool. For configuration use `.golangci.yml` (or toml/json).
369-
2. Use custom CI: just run `golangci-lint` in CI and check exit code. If it's non-zero - fail the build. The main disadvantage is that you can't see found issues in pull request code and should view build log, then open needed source file to see a context.
370-
If you'd like to vendor `golangci-lint` to fix it's version run:
369+
2. Use custom CI: just run `golangci-lint` in CI and check the exit code. If it's non-zero - fail the build. The main disadvantage is that you can't see found issues in pull request code and should view build log, then open needed source file to see a context.
370+
If you'd like to vendor `golangci-lint` in your repo, run:
371371
```bash
372372
go get -u github.com/golang/dep/cmd/dep
373373
dep init
374374
dep ensure -v -add github.com/golangci/golangci-lint/cmd/golangci-lint
375375
```
376-
And in CI run next command to install vendored `golangci-lint`: `go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`.
376+
Then add these lines to your `Gopkg.toml` file, so `dep ensure -update` won't delete the vendored `golangci-lint` code.
377+
```toml
378+
required = [
379+
"github.com/golangci/golangci-lint/cmd/golangci-lint",
380+
]
381+
```
382+
In your CI scripts, install the vendored `golangci-lint` like this:
383+
```bash
384+
go install ./vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/`
385+
```
386+
Vendoring `golangci-lint` saves a network request, potentially making your CI system a little more reliable.
377387

378388
**Q: `golangci-lint` doesn't work**
379389
1. Update it: `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`

0 commit comments

Comments
 (0)