Go Development Notes

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

Construction of the development environment:

First, the download address--The current is the latest 1.4

Http://code.google.com/p/go/downloads/list
Downloading the MSI version is not recommended. Need to turn over the wall, here to provide the latest version of the download address: http://download.csdn.net/detail/he90227/8325177 Second, the configuration environment variable $goroot point to Golang after installation of the root directory, E:\go\golang \go.
$GOBIN point to the Bin directory in the root directory after installation, mine is E:\go\golang\go\bin--Configuration Goroot and Gobin (if you download an MSI installation, it will automatically write to the environment variable without our configuration) right-click My Computer--Properties--advanced--environment variable new goroot configuration E:\go\golang\goNext, the path of the bin is added to path%goroot%\bin; finally open cmd, run go version, if you see the following information description of the configuration environment variable success Three, hello go write a simple Hello World
 Package Main Import "FMT"func Main () {    fmt. Printf ("hello,go!\n")}

Let's Analyze This program:

1, the 2nd line of the program this is necessary. All go files start with package <something> and must be package main for standalone run files;

2. The 4th Line said that the "FMT" package should be added to main. Other packages that are not main are called libraries, and many other programming languages have similar concepts.

3, 1th and 4th lines//AND/*---*/are comments

4, the package main must appear first, followed by import. In go, the package always appears first, then import, then everything else. When the Go program executes, the function that is called First is Main.main (), which is inherited from C. This function is defined here;

5. Line 8th calls the function from the FMT package to print the string to the screen

The above explanation comes from a blog from the Arab

Switch to the Hello.go directory and perform the Go Run Hello.go Quad, Golang IDE selection currently  Sublime Text 2 and VIM provides plug-ins for developing Golang. Interested can be here golangide because of their long-term exposure to eclipse, so accustomed to eclipse+plugin mode of course, Eclipse did not let me down, provided the development of Golang plug-in Goeclipse install plug-in address is HTTP ://goclipse.googlecode.com/svn/trunk/goclipse-update-site/If you find that the wait time is too long, you can change the HTTP to HTTPS, the same method for other Eclipse plug-ins to restart after download , the configuration of Goeclipse under configuration is ready to be configured, create a Go project, and create a go file. Note that hello.go need to be placed under SRC to run the last two sentences, all along, I like to install the Eclipse plugin offline, this time is useless, was tried before but failed, after installation, found that the right button does not have the run Go Application command originally tried to install
    • Goclipse_0.7.5.v432.jar

Found no, specifically in the online installation of the time to see the next, found that the eclipse download is

    • Goclipse_0.7.6.v450.jar

So suggest interested friends can try the next

The method is as follows

Under Eclipse of the plugins, the above plug-in directly into the restart, the normal is installed Goeclipse, you can see the right button to generate a run GO application

If you can't change it to dropins download, try it.

Finally, you can try link mode

Create sub-files in the links and Otherplugin folders and their otherplugin directories under the Eclipse directory Goeclipse

The previous jar package and its https://goclipse.googlecode.com/svn/trunk/goclipse-update-site/

    • Artifacts.jar
    • Content.jar
    • Features/goclipse_feature_0.7.6.v450.jar

Copy to the Goeclipse directory

In the links and then create the Goeclipse.link file

and insert Path=goeclipse in the Goeclipse.link directory assuming Otherplugin is located under D:\eclipse\otherplugin path=d:\eclipse\otherplugin\ Goeclipse Go luck!

Another eclipse plugin for go:

https://github.com/GoClipse/releases/raw/master/

Goclipse is an Eclipse plugin that adds the Go Language programming feature to the Eclipse platform. The purpose of Goclipse is to create an environment for beginners to develop the go language. The platform has been slow to develop, but has continued.

Click here to learn how to configure goclipsefor Google App Engine .

Update Site https://github.com/GoClipse/releases/raw/master/

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.