This is a creation in Article, where the information may have evolved or changed.
1: First download go source https://golang.org/dl/[according to different environment selection]
2: New File project folder holds D:/go_project
Create bin src pkg subfolder separately
3: Configure Environment variables
Goroot = "D:\Go" (Go installation path)
Gopath = "D:\Go_project" (custom)
Second, install sublime Text
1. Download Sublime Text http://www.sublimetext.com/
2. Installing Package-ctrl
Enter under View->show console
Import Urllib.request,os; PF = ' package control.sublime-package '; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); Open (Os.path.join (IPP, PF), ' WB '). Write (Urllib.request.urlopen (' http://sublime.wbond.net/' + pf.replace (', '%20 ')) . Read ())
Enter, restart sublime after success.
3. Install Gosublime, sidebarenhancements
Press CTRL +SHIFT+P to open the package Ctrl enter install press ENTER to enter the installation page.
Enter Gosublime to locate and then enter install. (some slow, wait until the input box pops up to search)
Third, installation Gocode
Open the console and enter the following:
Go get-u github.com/nsf/gocode
Go Install Github.com/nsf/gocode
(You need to install GIT tools to configure the GIT environment; C:\Program Files\git\bin; C:\Program Files\git\libexec\git-core;)
Windows git download http://msysgit.github.io/
Four, Ctrl+b automatically run go
Tools->build system->new Build System
Modify text
{
"Shell_cmd": "C:\\go\\bin\\go run $file",
"Encoding": "Utf-8"
}
Then save Gobuild.submlime-build
Then Tools->build System selects Gobuild
Five, write a hello.go file test open
Then press CTRL+B.
Package Main
Import (
"FMT"
)
Func Main () {
Fmt. Println ("Hello world!")
}
The address will appear: Hello world! Installation Successful
Reference Document: http://www.w3hacker.com/sublime-text-3%E6%90%AD%E5%BB%BAgo%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%EF%BC% 88window-7%ef%bc%89.html