Brother Lian Blockchain training technology share go language Ubuntu environment

Source: Internet
Author: User
Tags install go gocode

Due to the current user's lack of knowledge of the blockchain, coupled with the shortage of professionals in the blockchain and the lure of high salary, the market has spawned a number of blockchain training institutions. Brother Yun Jong, president of the Blockchain training Institute, says consumers need to be careful to differentiate themselves from the chain of training in the blockchain market.


The go language is optimized for programming multi-processor system applications, with go-compiled programs that are comparable to C or C + + code, and are more secure and support parallel processes.

Ubuntu Install go:

sudo add-apt-repository ppa:gophers/go

sudo apt-get update

sudo apt-get install golang-stable

Or

sudo apt-get install Golang

or download the Go language installation package directly


Environment configuration:

Vi/etc/profile

Join

Export Goroot=/usr/lib/go

Export goarch=386

Export Goos=linux

Export Gopath=/home/administrator/workspace/go

Export gobin= $GOPATH/bin

Export path= $GOPATH/bin: $PATH


Source/etc/profile


Create a new three directory under new Gopath

mkdir src Pkg Bin

SRC Storage Source

Pkg to store compiled generated files

Bin holds the resulting executable file


Create your first Go app

CD $GOPATH/SRC

mkdir test1

CD Test1

VI T1.go


[CPP] View plaincopy

Package Main


Import "FMT"


Func Main () {

Fmt. Println ("Hello World, I ' m learning Golang")

}

Main.main () is the entrance to the Go app

Compilation method

1, enter the corresponding application package directory, and then perform go install, you can install the

2. Execute the following code in any directory go install test

3, enter the corresponding application package directory, and then execute go build, will generate the executable file in the current directory


Configure VIM to support go language syntax highlighting

Cp-r $GOROOT/misc/vim/* ~/.vim/Note: $GOROOT is the Go installation directory

VI ~/.VIMRC Join

FileType plugin indent on

Syntax on


Installing Gocode


Go get-u github.com/nsf/gocode

The Gocode is installed by default under $gobin.


Configure Gocode


~ CD $GOPATH/src/github.com/nsf/gocode/vim

~./update.bash

~ Gocode Set Propose-builtins True

Propose-builtins true

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.