Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configure the GO environment and install IDE

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

I. Environmental preparation

Operating System: Ubuntu 16.04

GO Version: 1.9.2

Get Go installation package

$ wget https://www.golangtc.com/static/go/1.9.2/go1.9.2.linux-amd64.tar.gz

Extract the installation package

#Create language directory to store go program--GOROOTmkdir /opt/language/#Create go and three directories under go to store go package, binary, source code--GOPATHmkdir -p /go/{src,bin,pkg}$ tar -xvf go1.9.2.linux-amd64.tar.gz -C /opt/language/

Configure environment variables

$ sudo vim /etc/profile.d/go.sh export GOROOT=/opt/language/go export GOBIN=/opt/go/bin export GOPATH=/opt/go export PATH=$PATH:$GOROOT/bin#Load environment variable file $ source /etc/profile.d/go.sh

View GO Configuration

$ go env

II. Configure GO IDE

Download and install atom

#Download atom$ wget https://github.com/atom/releases/download/v1.23.3/atom-amd64.tar.gz Extract atom to/opt under $ tar -xvf atom-amd64.tar.gz -C /opt Go to atom directory $ cd /opt/atom/#Start atom$ ./ atom

Configuration atom

Install go-plus

III. Code preparation

Hello world Hello world

$ vim hello.go//Specify program entry, main package main//import fmt package import "fmt"//execute main function func main() { fmt.Println("Hello world! ")}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report