The Go language installation has been debugged

Source: Internet
Author: User
Tags configuration settings install go gocode
This is a creation in Article, where the information may have evolved or changed.

Go language as a Google's main language, a lot of people have been studying recently, but also spent a little time to test his installation, I use sublime Text 2 + gosublime + Gocode


As the name implies first is to install go, here are very detailed installation instructions, Http://code.google.com/p/golang-china/wiki/Install or http://golang.org/doc/ Install (golang.org himself to the hosts), the official support for the Windows version


Download unzip config environment variable

Environment variables (environment variables, advanced system settings, My Computer), under the tags of the system variables, create a few key-value pairs as follows:


(1). New variable name: GOBIN variable Value: C:\go\bin


(2). New variable name: Goarch Variable Value: 386


(3). New variable name: GOOS Variable Value: Windows


(4). New variable name: Goroot variable Value: C:\go


(5). Edit path at the end of the variable value of path plus%gobin%




1. Download Sublime Text 2, address as follows: http://www.sublimetext.com/


2. After the decompression, double-click Sublime_text, you can use sublime text 2.

Crack:

Edit the Sublime_text_backup.exe file with WinHex, jump to 000cbb70 Line, and the line 8A c7>C3 modified to B0 and saved

Cracked Registration Successful



3. Install the package Control, after opening Sublime Text 2, press the shortcut key Ctrl + ', open the Command window line (specific in View--show Console), and enter:


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


Above input Gosublime Select Gosublime Carriage return

This machine has been installed so there is no option, enter go build to select Enter (this is optional)

To this gosublime installation succeeded


6. Install Gocode below,


First install the git-1.7.11-preview20120710.


Open the console and enter the following:


Go get Github.com/nsf/gocode


Go Install Github.com/nsf/gocode


Go get Github.com/disposaboy/margo

Go Install Github.com/disposaboy/margo


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 the Gosublime, and then find Settings–default. Re-open the file, add the following configuration, and save:


"env": {"path": "C:/go/bin;"},

Well, so far, the development environment has been built.

The following can be freely programmed. Oh.


Pressing the shortcut key below the Ctrl + B interface will appear as follows:

Well, by now, the development environment has been built.


The following is the content I do not use this side can still use:

Sublime Text 2 Compilation configuration settings method


Tools->build System->new Build system creates a new configuration file that is set to


{

"cmd": ["Go", "Run", "$file _name"],

"File_regex": "^[]*file \" (...) \ ", line ([0-9]*)",

"Working_dir": "$file _path",

"Selector": "Source.go"

}

And then you can compile it with ctrl+b.


Save

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.