当前位置:网站首页>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
边栏推荐
- General paging 01
- Heap overflow of kernel PWN basic tutorial
- MySQL从基础到入门到高可用
- 自定义zabbix agent rpm包
- OpenSSL version upgrade
- leetcode剑指offer JZ3 数组中重复的数字
- Simple three-step fast intranet penetration
- RAID5 and LVM are used in combination
- Quickly and simply set up FTP server, and achieve public network access through intranet [no need for public IP]
- 三分钟记住20道性能测试经典面试题
猜你喜欢
随机推荐
SSH远程访问及控制
NFS共享服务及实验
使用自定义zabbix包(4.0.5版本)安装agent和proxy
Crud of MySQL
Life warning Maxim
LuckyFrameWeb测试平台(一款支持接口自动化、WEB UI自动化、APP自动化,并且支持分布式测试的全纬度免费开源测试平台)
Modeling of XML
Top 10 vulnerability assessment and penetration testing tools
How to build a website full of ritual sense and publish it on the public website 1-2
LVM and disk quota
Server hardware and RAID configuration practice
【219】app 测试和web测试的区别点?
IP job (1)
Windows下bat脚本备份MySQL数据库
进程和计划任务管理
Website B video is embedded in the web page, and relevant controls are hidden
测试经理/测试组长/测试主管面试题
IP notes (8)
常用工作方法总结(7S、SWOT分析、PDCA循环、SMART原则、6W2H、时间管理、WBS、二八原则)
Unable to boot after permanent mounting









