This is a creation in Article, where the information may have evolved or changed.
Under Ubuntu development environment
Download Address
After entering the download directory, run the following command to unzip the downloaded Go development package /usr/local
. The official recommended catalogue.
tar -C /usr/local -xzf go1.8.linux-amd64.tar.gz
Configuration variables
Open /etc/profile
or $HOME/.profile
file, add the following content
export PATH=$PATH:/usr/local/go/bin
When customizing the installation directory: Goroot is the Custom installation directory
export GOROOT=$HOME/go1.Xexport PATH=$PATH:$GOROOT/bin
Open terminal, run to go env
see if there is no output environment information. There is a successful configuration
Installing Sublime
Go to website download
CTRL + ' Enter the following to install the package Control
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())
Sublime Installation
Sublime Input Chinese
Installing the Gosublime Plugin
GoSublime
errors may occur after installation:
MarGo: Missing required environment variables: GOPATH
This is because of a configuration problem. Open GoSublime
the configuration file.
Enter the information configured above
{ "env": { "GOPATH": "$HOME/golang", "GOROOT": "GOROOT=$HOME/go1.X" }}
Test
package mainimport "fmt"import "runtime"func main() { fmt.Printf("format %s", runtime.Version())}
Use Sublime
Press ctrl+b
to run the next program to see the output.