当前位置:网站首页>Go environment construction and start
Go environment construction and start
2022-07-24 06:33:00 【Laughter addiction】
go Introduction to
One 、go The origin of
Go Language is also called Golang Language , It's Google Goggle The company to launch .
Two 、go Characteristics
1. Automatic garbage collection
2. Function can return multiple values
3. Concurrent programming
4. No dependence on hell , Even glibc
5. Compile once , Copy anywhere , Deployment is extremely convenient
go Configuration of language development environment
One 、go Installation

linux Platform installation go
1. Get into tmp Under the table of contents
2.wget https://golang.google.cn/dl/go1.18.3.linux-amd64.tar.gz
3.tar -xzvf go1.18.3.linux-amd64.tar.gz
4.mv go /usr/local/
5. stay ~/.bashrc Add GOPATH Variable
# The installation directory
export GOROOT=/usr/local/go
# Code directory
export GOPATH=~/code
export PATH=$GOPATH:$GOROOT/bin:$PATH
6. Restart it ~/.bashrc file
source ~/.bashrc
7. Test for successful installation
go version
If there is go Output of version number , explain go The command installation succeeded
Mac Platform installation go
brew install go
go version
go version go1.18.3 darwin/amd64
windows Platform installation go
1、 download :
Download path :https://golang.google.cn/dl/go1.18.3.windows-amd64.msi
2、 install msi file
Add the installation path to the environment variable :
Such as :go The installation to C:\Program Files\Go Catalog , Then add the environment variable GOPATH: C:\Program Files\Go\
And will %GOPATH%\bin Add to PATH
If you install , The system automatically adds GOPATH environment variable , Then we'll just 3、 Add one after another GOROOT environment variable 

4、 Check
open cmd Command line , Input : go version
Two 、IDE Installation
linux platform vim To configure
1. download Vim Configuration tool
git clone https://github.com/lexkong/lexVim
2. Get into lexVim Catalog , download go ide The required binaries :
cd lexVim
git clone https://github.com/lexkong/vim-go-ide-bin
3. Start the installation script :
./start_vim.sh
Be careful , If the above method cannot be installed , It can be used from windows Put it directly inside lexVim Files are sent in , Special attention is paid to the problem of carriage return and blank space , We can download dos2unix solve
When the following problems occur, it is the problem of newline 
terms of settlement
yum install dos2unix -y
dos2unix start_vim.sh
vim IDE Common functions
1.gd perhaps ctrl + ] Jump to the corresponding function source => If there is no response, please wait , It may be slow
2.ctrl + o Jump to the previous position
3.<F1> Open help , :q sign out
4.<F2> Open the directory window , Press again to close the directory window
5.<F4> List of recent documents , :q sign out
6.<F6> Add function comments
7. other :
<F3> Exhibition tag, Press again to close tag window
<F5> stay Vim Open the file search window above , :q sign out
ctrl + t Label withdrawal
<F9> Generate tag
Be careful :
1、 Jump from code to code , Place the cursor over a function call , Press ctl + ] It will jump to the definition of the function , Press ctrl + o Will jump back .
2、 Exit a window in a certain mode , Use last line mode :q that will do
3、 stay vim Paste text in , need :set paste It can be pasted normally !
windows platform goland install
Download address :https://www.jetbrains.com/go/
You can try 30 God , Self cracking
边栏推荐
- [218] what are the advantages and disadvantages of CS architecture and BS architecture and data on the server and client?
- Use and principle of spark broadcast variable and accumulator
- Use of MySQL
- UE4 reload system 1. basic principle of reload system
- 常用工作方法总结(7S、SWOT分析、PDCA循环、SMART原则、6W2H、时间管理、WBS、二八原则)
- MySQL Index & execution plan
- PXE technology network installation
- 【218】CS架构和BS架构以及数据放在服务端和客户端的利与弊?
- IP lesson summary (3)
- Public access intranet IIS website server [no public IP required]
猜你喜欢

【226】wireshark的参数使用说明

Website B video is embedded in the web page, and relevant controls are hidden

SSH远程访问及控制

Mysql database - SQL summary (remember to pay attention to me! Come on in China!)

IP notes (8)

Server hardware and RAID configuration practice

Leetcode剑指offer JZ9 双栈实现队列

NFS共享服务及实验

Luckyframeweb testing platform (a full latitude free open source testing platform that supports interface automation, Web UI automation, APP automation, and distributed testing)

进程和计划任务管理
随机推荐
Set up a WordPress personal blog locally and launch it through the intranet (22)
IP job (1)
IP notes (6)
Custom MVC 1.0
Quickly and simply set up FTP server, and achieve public network access through intranet [no need for public IP]
Use of MySQL
[222] memory overflow and location
LVM与磁盘配额
The public network uses Microsoft Remote Desktop remote desktop to work remotely at any time
Flink function (1): rich function
Ia note 1
Remote connection to Qunhui NAS at home [no public IP, free intranet penetration]
FTP service and experiment
【217】#!/ The meaning of usr/bin/env
力扣986.区间列表的交集
Summary of common working methods (7S, SWOT analysis, PDCA cycle, smart principle, 6w2h, time management, WBS, 28 principles)
文件系统与日志分析
DNS域名解析服务
IP notes (12)
Flink production environment configuration recommendations