This is a creation in Article, where the information may have evolved or changed.
preparatory work:
1. Set up a system environment variable similar to the following :
Set goarch=386 set Gobin=c:\go\bin set gochar=8 set Goexe=.exe set gohostarch=386 set Gohostos=windows set goos=windows set Gopath=e:\mygo set gorace= set Goroot=c:\go set gotooldir=c:\go\pkg\tool\windows_386 set CC=GCC set gogccflags=-g-o2-m32-mthreads set cgo_enabled= 1
2. go to sublime text in the install package search gosublime
3. Download Gocode
the command line to go working directory (thatis, Gopath) executes:
Go get-u-ldflags-h=windowsgui Github.com/nsf/gocode
and then to go working directory (i.e. Gopath below \ bin to find Gocode.exe copy one to C:\go under
4. Open the Sublime Text menu Preferences, package Settings, Gosublime->settings-user and enter:
{" env": { "goroot": "C:\\go",//go installation path "GOBIN": "C:\\go\\bin", "Gopath": "E:\\mygo",//The work path of your go " Goarch": "386",//system variable inside the Gohostarch, 386 for 32-bit platform, AMD64 for 64-bit platform "GOOS": "Windows",//System inside the GOOS "PATH": "% gobin%;%path% " }, " comp_lint_enabled ": true, //Open this only to the contents of the comp_lint_commands tag below " Comp_ Lint_commands ": [{" cmd ": [" Go "," Install "]}], " On_save ": [{" cmd ":" Gs_comp_lint "} //When the command executed automatically with CMD on save]}
5. Restart after saving; Sublime text any of the files in your go project can be applied to the third-party package's self-help hint