A Sublime Text package for working with Go.
- Code completion (using
gocode) - Code format (using
goimports) - Goto definition (using
guru). Support modified files. - Linter (using
golint,go vet,megacheckwithSublimeLinter) - Real-time linting (using
gotype-live) - Find all references (using
guru). Support modified files.
You probably need to install some golang tools:
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/nsf/gocode
go get -u golang.org/x/tools/cmd/guru
go get -u golang.org/x/lint/golint
go get -u github.com/tylerb/gotype-live
go get -u honnef.co/go/tools/cmd/megacheckMake sure SublimeLinter is installed in order to have lint features.
The plugin contributes the following settings:
go_override_default_hot_keys: Override default hot keys to provide functionality from the package (default:true)- To have custom formatter before files saving, add a similar configuration to the following to
.sublime-projectfiles:
"golang": {
"pre_save_formats": {
"goimports": {
"cmd": ["gofmt", "-e"]
}
}
}TODO
See CHANGELOG.md file
- I didn't write all of them. Some python codes are copied from https://github.com/nsf/gocode/blob/master/subl3 or https://github.com/golang/sublime-config
See LICENSE file
Enjoy!