Go language common library and use Goglang IDE to write Go Project

Source: Internet
Author: User
Go Language Common library: Click to open the link


write the Go project using the Goglang IDE 1. New Go Item File===>new===>project ...
The last string in the first line of pop-up box is changed to the name of the item you want to create, click Create

An empty project folder is created 2. Create a project directory folder

In order to follow the Google Go Development specification and facilitate our subsequent work, we set up three folders under each project folder according to go requirements: (right key project name, New===>directory)

bin/    generated executable file pkg/   compiled intermediate file src/    program code file
3. Edit Project Example under SRC : Create a main folder in SRC to place the executable file. In creating a main.go. The contents are as follows:
Package main
Import "FMT"
func Main () {
  fmt. Println ("Hello world!")
}
4. Configure the operating environment File===>setting Open Settings Environment PM set goroot for you to install the Go software path
Second, set up the working directory of the Gopath,global Gopath to place the Go Project; project path chooses the directory where the current project is placed;
4. Configure compilation and operation Environment right key project name = = "Run, will pop up the following pop-up box, no can be found in the upper right corner of the edit Configuration."

5. Compile and run


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.