"Go language from zero single row 1" in Mac environment configuration Go,hello world!

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

Today finally a holiday home, Taiyuan also under a long absence of snow, very suitable for writing code learning.

The go language is widely watched as a young and sharp language, and the very hot Docker is also based on the go language. I think in the future work, go, Docker I will be a lot of contact, early mastery is also a great advantage. Also influenced by the friends and the future boss, determined to start learning the go language from zero.

It is mainly divided into prophase, mid-and late-stage bar. Ready to follow the no-smell of Go programming basic video, while watching and knocking, read a few books to consolidate the foundation. Then the mid-term goal is to do a project before school, hanging to GitHub. After the entry, continue to learn to take the go related projects as far as possible. Later I think it is possible to write a book ... I'll talk about it in a long time.

I am using Mac,os X 10.9.5,go installation not much to mention. The main record is the process with sublime text 3 and Gosublime.

First download ST3,HTTP://WWW.SUBLIMETEXT.COM/3 on official website

After installation, you must complete the package control for Go programming plug-in preference. A general tutorial will show you a bunch of code. In fact, the best way is to copy the website, because this code will change as the version changes. control+ To open the window, copy the code on the website after pasting it.

Download Gosublime, install, and then you can happily write the go code.

In addition, godoc-http=:8080 can place documents locally, after all, GFW.

Hello World Code, MAIN.GO

Package Mainimport ("FMT") func main () {FMT. Println ("Hello world! Hello, world! ")}

It is simple to note that the import is followed by () and the main function must be in Main's package.

Some of my questions:

1, in the configuration need to create bin, pkg, src Three to separate storage, but the go build after the executable file or in the code src file, and did not go to the bin. It seems that go install will be in the bin, so this mechanism should be followed.




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.