当前位置:网站首页>[Yugong series] go teaching course 002 go language environment installation in July 2022
[Yugong series] go teaching course 002 go language environment installation in July 2022
2022-07-04 03:57:00 【Hua Weiyun】
One 、Go Locale installation
Go Language is a compiling language, which needs SDK The toolkit compiles it to run , Second, you need an editing tool to write code , Finally SDK Tool configuration environment variables in , So the summary can include three aspects :
- SDK Kit installation
- VSCode install
- Environment variable configuration
Go Language supported systems include :Linux、FreeBSD、Mac OS X( Also known as Darwin)、Windows.
When will Go When the language source code is written, the computer cannot directly execute , You need to use a compiler to compile it into a binary executable , Then we need to use Go Linguistic SDK The kit .
Go Language SDK Installation package download address :https://golang.google.cn/dl/

Windows You can use .msi suffix ( The file can be found in the download list , Such as go1.18.3.windows-amd64.msi) Installation package to install .
By default .msi The files will be installed in c:\Go Under the table of contents . You can take c:\Go\bin Directory added to Path In the environment variables . After adding, you need to restart the command window to take effect .

Enter the following command to test whether the installation is successful
go version # Output version information go env # environmental information 
Two 、 first Go Program
Go The flow chart of language operation is as follows :

1. Command line run
Script code test.go as follows :
package mainimport "fmt"func main() { fmt.Println("Hello, World!")}Command line run :
go run test.go
Translate it into exe function
go build test.go ./test.exe3、 ... and 、Go Language multi version control
occasionally , We will meet with Go Multiple versions of the language , To solve the need to install different versions in different scenarios , It can easily switch between different versions , Here's a recommendation gvm.
gvm yes Go Version Manager , Use shell Script development . You can install it according to the file , Reference resources : https://github.com/moovweb/gvm .
After installation , We can install other go Version of the .
gvm install go1.17.6gvm use go1.17.6After executing the above command, you can add a new version Go ,GOPATH、GOROOT And other environment variables will be automatically set , Then you can directly use the specified version Go The language .
summary

边栏推荐
- Epidemic strikes -- Thinking about telecommuting | community essay solicitation
- Day05 錶格
- 【读书会第十三期】多媒体处理工具 FFmpeg 工具集
- Formulaire day05
- Objective C attribute keyword
- Illustrated network: what is the hot backup router protocol HSRP?
- Objective-C description method and type method
- [.NET + mqtt]. Mise en œuvre de la communication mqtt dans l'environnement net 6 et démonstration de code pour l'abonnement et la publication de messages bilatéraux du serveur et du client
- [untitled]
- Explain AI accelerator in detail: why is this the golden age of AI accelerator?
猜你喜欢

'2'>' 10'==true? How does JS perform implicit type conversion?
![Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure](/img/ba/c1d40de154344ccc9f2fd1dd4cb12f.png)
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure

Rhcsa day 3
![[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush](/img/94/2bdc31ec05595dbbc8a7a8d6b22252.jpg)
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush

Objective-C description method and type method

Reduce function under functools

logistic regression

2022-07-03:数组里有0和1,一定要翻转一个区间,翻转:0变1,1变0。 请问翻转后可以使得1的个数最多是多少? 来自小红书。3.13笔试。
![[untitled]](/img/b5/bf76783aa428222623d760756a14d9.jpg)
[untitled]

functools下的reduce函数
随机推荐
Consul of distributed service registration discovery and unified configuration management
What is the difference between enterprise wechat applet and wechat applet
Why is it recommended that technologists write blogs?
Pandora IOT development board learning (HAL Library) - Experiment 6 independent watchdog experiment (learning notes)
拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
Select sorting and bubble sorting template
2022-07-03: there are 0 and 1 in the array. Be sure to flip an interval. Flip: 0 becomes 1, 1 becomes 0. What is the maximum number of 1 after turning? From little red book. 3.13 written examination.
深入浅出对话系统——使用Transformer进行文本分类
用于TCP协议交互的TCPClientDemo
Recursive structure
Which product is better for 2022 annual gold insurance?
疫情来袭--远程办公之思考|社区征文
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
Simple dialogue system -- text classification using transformer
Rhcsa day 2
PID of sunflower classic
Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
JVM family -- monitoring tools
图解网络:什么是热备份路由器协议HSRP?
Mitsubishi M70 macro variable reading Mitsubishi M80 public variable acquisition Mitsubishi CNC variable reading acquisition Mitsubishi CNC remote tool compensation Mitsubishi machine tool online tool