This is a creation in Article, where the information may have evolved or changed.
Install Golang language
Download Golang installation package download address: https://golang.org/dl/, please download the appropriate version
我下载的是windows的版本,默认目录安装为C:\Go
Set environment variable path, add C:\Go\bin
environment variable
Set the environment variable Gopath, the variable is custom, I set to: d:\godev
, in the inside manually create SRC directory, the structure is as follows
SRC Place the source code, PKG is our compiled package storage location, bin is compiled executable document execution directory, after this we will understand
Development tools
Development tool Selection Sublime
- Installation Sublime text 2: Development tools Select Sublime2, download address: HTTP://WWW.SUBLIMETEXT.COM/2
-
Install package management tools, pack control: Open Sublime2, press the shortcut key Ctrl + ', or menu->view->show console to open the console, enter the following command
import Urllib2,os; pf= ' package Control.sublime-package '; Ipp=sublime.installed_packages_path (); Os.makedirs (IPP) if not os.path.exists (IPP) else None; Urllib2.install_opener (Urllib2.build_opener (urllib2. Proxyhandler ())); Open (Os.path.join (IPP,PF), ' WB '). Write (Urllib2.urlopen (' http://sublime.wbond.net/' +pf.replace (', '%20 '). Read () ); print ' Restart Sublime Text to finish installation '
Enter
-
Restart Sublime2, You can find the Proferences menu, the extra menu item, the package control
-
Press and hold the shortcut key CTRL + SHIFT + p or the menu preferences- box, enter the package install Enter, pop-up Packages dialog box, and then enter Gosublime Enter to install the Gosublime plug-in, the same way to install go Build
-
Modify the Gosublime configuration: Under the Preferences menu, locate the package Settings, find the Gosublime, and then find Settings-default. To open the file, add the following configuration and save the
Here we have completed the Golang development environment Setup