This is a creation in Article, where the information may have evolved or changed. Go is a compiled, hair-style, and garbage-collected programming language developed by Google. Robert Greysmore (Robert griesemer), Rob Paik (Rob Pike) and Ken Thompson began designing the Go language in September 2007, and the Go language was developed based on the Inferno operating system. The go language was officially launched in November 2009 and implemented on Linux and Mac OS x platforms. Go language mascot, very cute bar. The Go language Hello world! Code:
Package
main import "FMT" func Main () { fmt. Println ("Hello, World") }
Next comes the installation of the go development environment for everyone. First,
Install Go, here is a detailed installation instructions, Http://code.google.com/p/golang-china/wiki/Install or Http://golang.org/doc/install below we install under window, Google has a win installation package, for beginners or very simple! Https://code.google.com/p/go/downloads/list directly next .... Installation is very simple! Once you've installed go, we can
build the development environment, here I use Sublime Text 2 + gosublime + Gocode. For those who do not know sublime Text 2, you can look at the official website: http://www.sublimetext.com/(generally a lightweight, handy tool) 1. Download Sublime Text 2 at the following address: HTTP://WWW.SUBLIMETEXT.COM/2. After decompression, double-click Sublime_text, you can use sublime text 2. 3. Install the package Control, after opening Sublime Text 2, press the shortcut key
Ctrl + ', open the Command window line, ' This button on the TAB key above, I just started not found, hehe. Enter the following and return to:
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 '
4. After restarting Sublime Text 2, it is possible to find a menu item in the Preferences menus under the package Control. 5. Now that the Gosublime plugin is installed, press and hold ctrl+shilft+p will pop up a dialog box to enter install Enter to pop up an installation package dialog box such as Enter Gosublime Select Gosublime return input Go build Select Enter (this is optional) Done, Gosublime installed successfully. 6. Install Gocode below, open the console and enter the following:
go get github.com/nsf/gocode go install github.com/nsf/gocode
You can also go to GitHub to download https://github.com/nsf/gocode.git (to install Google's git version management tool) after the installation is complete, we can find an extra Gocode file in the Go/bin directory. (Be sure to put it in the bin directory) 7. Modify the Gosublime configuration: Under the Preferences menu, locate the package Settings, find Gosublime, and then find Settings-default. Re-open the file, add the following configuration, and save: Well, so far, the development environment has been built. Open Sublime Text 2, create a new helloworld.go, write the code as follows: witness the go code to automatically prompt the moment to enter a P return (enter key) Main method, the package is automatically generated for you. Here is an example of printing: pressing the shortcut key
Ctrl + bThe following interface appears below the interface: input
Go build hello.go
Run, also press the shortcut key
Ctrl + bThe following interface appears below the interface to enter the Hello return. Well, by now, the development environment has been set up, I hope you will also learn the language of go. Beginner's Guide: Getting Started API is the best new starter document I've ever seen and I hope go can flourish. Reference: [1] http://blog.csdn.net/love_se/article/details/7754274