This is a creation in Article, where the information may have evolved or changed.
Development about three years or so, but the use of Java, in addition to the company's projects, their own use of Java to do a task management system, Android did a few apps, think also should learn a new language, on-line browse the next, finally chose Go,let ' s go!
Download preparation
1: Download Go
Address: Http://www.golangtc.com/PS: Originally wanted to send the official website, but the celestial network you understand, simply not boring! Recommended download MSI package, ask me why: Save things.
2: Setting Environment variables
as follows:
GOARCH=AMD64//I am a Windows x64 system I'll just write 32.386
Gobin=c:\go\bin //go The bin inside the installation path
Goos=windows//I am windows I will fill out Windows Linux Mac self check
Gopath=c:\gopath//This does not need to create a new, and then in the new src, bin, pkg three directory
Goroot=c:\go//go Installation path
3: Download Sublime Text 3
Address: http://www.sublimetext.com/
3.1: Install the package Control
Ctrl+~ Open the Sublime console input as follows, you can install, if you want to network:
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 ())
PS: If Ann is unsuccessful, then please own Baidu, because this is not the point.
4: Install git
Download Address: http://git-scm.com/download/
PS: You ask me how Ann? Do not develop the software is not a good architect, fuck off!
5: Install Gocode
the console runs the following two lines:
Get Github.com/disposaboy/margo
6: Install the sublime plugin
need to install Gosublime and sidebarenhancements, other help yourself.
Ps:sublime How to insert a piece please own Baidu
After installation, under the Preferences menu, locate the package Settings, find the Gosublime, and then find Settings-default. Re-open the file, add the following configuration, and save: "env": {"path": "C:/go/bin;"},
7: Write test code
Create a new file called Hello.go
The contents are as follows:
Package Main
Import (
"FMT"
)
Func Main () {
Fmt. Println ("Hello and Fuck the World")
}
PS: I wipe, OSC editor Why not format it yourself
8: Run the Code
Juvenile prepare your left hand, press Ctrl+b to open the console, and then enter: Go Run hello.go
You'll see in the console:Hello and fuck the world
9: It's over, I just want to record!