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
,megacheck
withSublimeLinter
) - 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/megacheck
Make 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-project
files:
"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!