The Go language has been installed and debugged.

Source: Internet
Author: User
Tags install go gocode

As a main language of Google, the Go language has recently been studied by many people and has spent some time testing its installation. I use sublime text 2 + gosublime + gocode

As the name implies, the first is to install go, here there are very detailed installation instructions, http://code.google.com/p/golang-china/wiki/Install or http://golang.org/doc/install (golang.org to find their own hosts), the official version of Windows has been supported

Download and decompress the configuration environment variable

"Environment variables" (my computer> advanced system Settings> environment variables), under the system variables tab, create and edit the following key-value pairs:

(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). Add % Gobin % at the end of the variable value of path to edit path.

1. Download sublime text 2, address: http://www.sublimetext.com/

2. After decompression, double-click sublime_text to use sublime text 2.

Cracking:

Use winhex to edit the sublime_text_backup.exe file,Jump000cbb70That line8AC3ChangeB0 01Then save

Successful crack Registration

3. install package control. After opening sublime text 2, press the shortcut key Ctrl + 'to open the command window (In view -- show console), and press 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 'Please restart sublime text to finish installation'

4. After restarting sublime text 2, you can find a more menu item package control under the preferences menu.

5. Now you have installed the gosublime plug-in. Press Ctrl + shilft + P to bring up a dialog box. Enter install and press enter to bring up an installation package dialog box.

Enter gosublime and select gosublime and press Enter.

The local machine has been installed, so no option is displayed. Enter go build and select press enter (this is optional)

Gosublime has been installed successfully.

6. Install gocode below,

First install Git-1.7.11-preview20120710.

Open the console and enter the following content:

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 gosublime configuration: Under the preferences menu, locate package settings, find gosublime, and then find settings-default. To open the file, add the following configuration and save it:

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

Now, the development environment has been set up.

You can program it as needed. Haha.

Press the shortcut key Ctrl + B to display the following interface below the interface:

Now, the development environment has been set up.

The following content can be used even if it is not used:

How to configure sublime text 2 Compilation

Tools-> build system-> new build system create a configuration file and set it

{

"Cmd": ["go", "run", "$ file_name"],

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

"Working_dir": "$ file_path ",

"Selector": "source. Go"

}

Then you can use Ctrl + B to compile it.

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.