Open the Golang Tour

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

If you are interested in Golang, but have not yet begun to get started, this article is for you.

Why do you study Golang?

Lobby developers try to golang a lot of articles. For example, Golang's main designer's speech, a German spit slot, the domestic Golang evangelist book preface. I do not want to repeat the views of Daniel, just to talk about their simple feelings.

Before I learned Golang, I was a fan of Java, like most users of Iteye. Yes, I like Java, Open source, cross-platform, powerful IDE support, and most importantly--lots of job opportunities.

But at the same time I hate Java. The bloated and indispensable IDE always gives me the urge to flee. The lack of expression in language makes me feel like a wordy aunt. Cumbersome configuration let me see the XML file just want to vomit.

When I came into contact with Golang, I realized that most of my imagination in programming languages was achieved in Golang:

1. No IDE support is required, so you can configure the perfect editing environment with just a few simple steps.

2. Both the development efficiency of dynamic language and the operation efficiency of static language. Some people say that Golang is a combination of C and Python, which is very aptly described.

3. Stay away from XML.

4. Natural affinity with the *nix system.

5. Enjoy the fun of growing, progressing and maturing with the language.

Now I write Java code in the company during the day, while the spare time is all given to Golang.

Installation and Environment configuration

Click to download the Golang installation package, if the link is inaccessible (a wonderful wall), try to:

173.194.71.141 golang.org

Join the Hosts file.

The environment variables that need to be configured are (in Linux, for example):

SH code
    1. Export goroot= $HOME/go # Go install directory
    2. export path= $PATH: $GOROOT/bin # Add the Bin folder of the installation directory to the PATH variable
    3. Export Gopath=~/dropbox/source/go # Gopath store personal Source code

Enter go version on the command line to verify that everything is going well.

Editor

It is strongly recommended to use sublime Text 2 + gosublime + Gocode + Margo to build the Golang editing environment.

Where Gosublime is a plug-in for sublime Text 2, and Gocode and Margo provide code auto-complement functionality for Gosublime.

For an introduction to sublime Text 2, please refer to here.

Recommended reasons:

Supports all platforms.

The Sublime Text 2 interface is refreshing and reacts extremely quickly and is very comfortable to use. It does not give people the feeling of being bloated like an IDE.

Installation steps:

1. Download the installation Sublime Text 2.

2. Install the package control, which is used to manage ST2 plugins. Open Sublime Text 2, press ctrl+~, and enter the following command into the console:

Python code
    1. import  urllib2,os ;   
    2. " package  Control.sublime-package ' ;   
    3. ipp=sublime.installed_ Packages_path ();   
    4. os.makedirs (IPP)  if  else   None ;   
    5. open (Os.path.join ( IPP,PF), '). Write (Urllib2.urlopen ( +pf.replace (   ' , "% )). Read ())   

3. Restart ST2, if you see the package control in Preferece-package settings to indicate that the installation was successful.

4. Install the Gosublime plugin via the package control. Press CTRL+SHIFT+P, enter install and return. After waiting for the response, enter gosublime and choose to install.

5. In the Bash/dos command line, enter:

Go get-u github.com/nsf/gocode

Go get-u Github.com/disposaboy/margo

Go Install Github.com/nsf/gocode

Go Install Github.com/disposaboy/margo

After installing Gocode and MarGo, switch to the $gopath/bin directory and run./margo.

At this point, the editing environment configuration is complete, click to view the final interface.

Document

You can either access the Golang.org/doc directly or enter it at the command line:

godoc-http=:8080

After accessing the local image:

localhost:8080

Introductory books

At the outset, it is recommended to study the A-tour-of-golang on the official website.

Next, Learning-go is a good open source book, its Chinese version by xingxing translation and maintenance, translation quality is very good.

It is also possible to consider the recently published <<go language programming >>, the author of which is a pioneer in the domestic use of Golang to write large programs.

Students interested in the Web can focus on network program with Go, go Web programming, and more.

Community

It is recommended to join the Golang-china mailing list, the community is very active, the daily discussion email is basically more than 50. Of course, good English students can choose Golang-nuts.

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.