Go language Environment configuration and compiler ——— under Windows platform

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

The compiler of Go language windows can go to http://code.google.com/p/gomingw/downloads/list download

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%

The editor chooses Sublime Text 2, which is now very simple to configure, relative to others.

Sublime Text 2 Compilation configuration settings method

Sublime Text2+gosublime+gocode

This is a combination development tool

Benefits: Automated Prompt code

Automatically format code when you save to make your code more aesthetically pleasing to the Golang standard

Support Project Management

Support Syntax highlighting

Sublime Text2 free, even if the expiry (save a certain number of times) also reminds you, if wearies words can be cracked.


The first step:

Download Sublimetext and install

http://www.sublimetext.com/



Open sublime_text.exe,ctrl+ ' Open command line, execute the following code, paste the following code in the bottom rectangle input box:

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 '

Then turn off restart. Can be found in the menu bar more than one of the following columns

Description The package control has been installed successfully

Step Two:

Next Install Gocode Https://github.com/nsf/gocode

Open CMD to run the following code

Go get Github.com/nsf/gocode

Go Install Github.com/nsf/gocode

Note: If CMD does not work, install a git, execute the above code, will appear in the Go/bin directory Gocode.exe of course, this directory is set according to your environment variables, so the preceding environment variables should be correct.

Gocode.exe, this is a service that is resident backstage.

Step Three:

After installation, you can install Sublimetext plug-ins, install Gosublime, sidebar (enhanced sidebar), after installing the plugin remember to restart Sublimetext effective

Ctrl+shift+p Open the package controll input PCIP

At this point, the lower left corner shows that the packet data is being read

This time input gosublime, press OK to start the installation, the same way to install sidebar

Fourth Step:

To verify that the installation was successful, you can open Sublimetext, open main.go, and see if the syntax is highlighted

Hit IM is not shown below

Import "FMT" after playing fmt.p inside the function is not a hint

If this prompt is already present, you have completed the installation and have completed the automatic prompt

If there is no such hint, the general is that your path is not configured correctly, you can open cmd, input gocode, is not able to run correctly, if not, it means that path is not configured correctly







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.