Ubuntu Install Go language compilation environment

Source: Internet
Author: User
Tags install go


1. ubuntu install go language

sudo apt-get install Golang

2. Test Go

mkdir Code//Create a command for a folder named code

Vim test.go//command to create a go file named Test under VIM

Press I to enter insert mode, edit code

/*************************************************************************> File name:test.go> Author:acway > Created time:2015 January 10 Saturday 15:23 29 seconds *********************************************************************** */package mainimport "FMT" Func Main () {FMT. Println ("Hello word!\n");}


Press ESC to exit insert mode

: Wq//Save and Exit Vim command

Compiling go Programs

Go build test.go//Compile Test.go program

You can then enter the LS command to find an executable file named Test.


Enter "./test" to execute this file, the program run results can appear

Run Go Program

Go run test.go//Run Test.go Program


Ubuntu Install Go language compilation environment

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.