Skip to content
This repository was archived by the owner on May 7, 2021. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ install:
- go get -u golang.org/x/tools/cmd/goimports
- go get -u golang.org/x/tools/cmd/gorename
- go get -u github.com/sqs/goreturns
- go get -u github.com/mdempsky/gocode
- go get -u github.com/alecthomas/gometalinter
- go get -u github.com/zmb3/gogetdoc
- go get -u github.com/zmb3/goaddimport
Expand Down
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
This package includes the following functionality:

- Display information about your current go installation, by running `go version` and `go env`
- Autocomplete using `gocode`
- Format your code with `gofmt`, `goimports`, or `goreturns`;
optionally run one of these tools on save of any `.go` file
- Run `go install .` and `go test -c -o {tempdir} .` to verify your code compiles
and to keep `gocode` suggestions up to date
- Autocompletion
- Code formatting
- Compile on save
- Run a variety of linters (e.g. `golint`, `vet`, etc.) against your code using [`gometalinter`](https://github.com/alecthomas/gometalinter), [`revive`](https://github.com/mgechev/revive) or [`golangci-lint`](https://github.com/golangci/golangci-lint)
- Run tests, display test output, and display test coverage using `go test -coverprofile`
- Display documentation for identifiers in source code using
Expand All @@ -41,10 +39,6 @@ The following commands are run for the directory of the current file:
- `go install .` (for normal `.go` files)
- `go test -o {tmpdir} -c .` (for `_test.go` files)

### Why Are You Running `go install` Instead Of `go build`?

`gocode` (and a few other tools, like `gotype`) work on `.a` files (i.e. the package object archive), and the way to keep these up to date is to run `go install` periodically. This ensures your autocomplete suggestions are kept up to date.

## Platforms

The package has CI for OS X, Windows and Ubuntu.
Expand All @@ -57,13 +51,12 @@ If you are missing any required tools, you may be prompted to install them. You
go get -u golang.org/x/tools/cmd/goimports
go get -u golang.org/x/tools/cmd/gorename
go get -u github.com/sqs/goreturns
go get -u github.com/mdempsky/gocode
go get -u golang.org/x/tools/cmd/gopls
go get -u github.com/alecthomas/gometalinter
go get -u github.com/mgechev/revive
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
go get -u github.com/zmb3/gogetdoc
go get -u github.com/zmb3/goaddimport
go get -u github.com/rogpeppe/godef
go get -u golang.org/x/tools/cmd/guru
go get -u github.com/fatih/gomodifytags
go get -u github.com/tpng/gopkgs
Expand Down
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ install:
- go get -u golang.org/x/tools/cmd/goimports
- go get -u golang.org/x/tools/cmd/gorename
- go get -u github.com/sqs/goreturns
- go get -u github.com/mdempsky/gocode
- go get -u github.com/alecthomas/gometalinter
- go get -u github.com/zmb3/gogetdoc
- go get -u github.com/zmb3/goaddimport
Expand Down
5 changes: 2 additions & 3 deletions lib/build/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ class Builder {
}
const srcDir = gopath + sep + 'src'
return srcDir.split(sep).every((t, i) => cwd.split(sep)[i] === t)
? 'install' // CWD is within gopath, `go install` to keep gocode up to date
: 'build' // CWD is outside gopath, `go build` will suffice
? 'install' // CWD is within gopath, `go install`
: 'build' // CWD is outside gopath, `go build`
}

async lintInstall(cmd: string, options: ExecutorOptions) {
Expand All @@ -177,7 +177,6 @@ class Builder {
}

// Include the -i flag with go install.
// See: https://github.com/mdempsky/gocode/issues/79
if (command === 'install' && !buildArgs.includes('-i')) {
buildArgs.push('-i')
}
Expand Down
Loading