- operating system: Ubuntu 14.04
- Go install:
- Download. Save directory:/home/xxxxx/download, file name: go1.4.2.linux-amd64.tar.gz.
- Extract to target directory, command TAR-ZXVF /home/xxxx (username)/download -C target directory.
- To configure environment variables:
- Open/etc/profile file, command: sudo gedit/etc/profile
- Add the following command at the end of the file:
- Export path= $PATH:/home/xxxx/go/bin
- Export Goroot=/home/xxxx/go
- Export Gopath=/home/xxxx/mygo
- Save the file, and then execute the following command after exiting: Source/etc/profile
- To check if the installation was successful, execute the command: Go version. The ability to display the version number (similar to go version go1.4.2) indicates that the installation was successful.
- Build three folders under the Gopath directory: bin,src,pkg
- Sublime Text 3 installation:
- Download. Save directory:/home/xxxxx/download, file name: Sublime-text_build-3083_amd64.deb.
- Install, execute command: sudo dpkg-i/home/xxxx/download/sublime-text_build-3083_amd64.deb
- Execute command: SUBL, can open sublime
- Install the package control plug-in for sublime text 3: Ctrl + ', open the command line and execute the following code:
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())
- Install git, execute command: apt-get install git.
- Install Gocode: Execute command: Go get github.com/nsf/gocode
- Install Margo: Execute command:go get github.com/slene/margo
- Install Gosublime:sublime text 3->references->package control->install package, search gosublime, select Install.
- Install other plugins in the same way
- Write the Go code and run:
- Resolution Sublime Text 3 cannot be entered in Chinese:
- sudo apt-get install build-essential
- sudo apt-get install Libgtk2.0-dev
- Not to be continued
Go Programming Environment Installation (1:GO installation)