当前位置:网站首页>Go language | 01 wsl+vscode environment construction pit avoidance Guide
Go language | 01 wsl+vscode environment construction pit avoidance Guide
2022-07-05 19:52:00 【"Lose a shoe"】
List of articles
Preface
Because of work , Need to use Go Language development , As an embedded Developer , The soldiers came to cover the water
Go The language is designed as an application for carrying Web The server , System programming language for storage cluster or similar giant central server .
For the field of high-performance distributed systems ,Go Language is undoubtedly more efficient than most other languages . It provides massive parallel support , This is no better for the development of the game server .
Go Download and install the installation package
https://studygolang.com/dl
The development environment is WSL, So choose Linux Version download
Find a location to extract the file after downloading
Execute the decompression instruction
tar zxvf go1.18.3.linux-amd64.tar.gz
Take the decompressed go Copy folder to home Under the table of contents , You can also define , But remember your own directory
Start configuring the environment
It is recommended to create in the same directory go Language workspace folder , I have a new one here gopath Folder , Path is /home/gopath.
sudo nano /etc/profile
Then add... At the end of the open file :
export GOROOT=/home/go
export GOPATH=/home/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
export GOPROXY="https://goproxy.io"
source .bash_profile
Then refresh the document
source /etc/profile
The environment here is global
Last run
go version
Fill in these two directories according to your own situation export GOROOT=/home/go;export GOPATH=/home/gopath
Check the installation
Here is a sample code
Save as .go File format
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
perform
go run test.go
You can see
Express Go Download and installation succeeded , But we must not stop here , We should make development humanized
Need to borrow VSCode
VSCode build
from Windows Open up our VSCode, Then remote to WSL
install Go plug-in unit
If we do the sample code directly F5 function , Prompt to install some packages
The direct click probability is that the installation fails
We need to operate alone , because dlv It mainly involves debug debugging
It is also an important tool for us to develop happiness index
dlv install
go install github.com/go-delve/delve/cmd/[email protected]
After confirming that GCC after , Return as prompted VSCode Re install dlv
Wait a moment
You can see the prompt success
here F5, Found that it still can't run
terms of settlement :
go env -w GO111MODULE=auto
OK! The environment was successfully built
边栏推荐
- Add data to excel small and medium-sized cases through poi
- 不愧是大佬,字节大牛耗时八个月又一力作
- C - sequential structure
- third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl
- selenium 元素信息
- Multi branch structure
- 什么是面上项目
- 挖财钱堂教育靠谱安全吗?
- 城链科技数字化创新战略峰会圆满召开
- Android interview, Android audio and video development
猜你喜欢
S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
城链科技数字化创新战略峰会圆满召开
安卓面试宝典,2022Android面试笔试总结
What do software test engineers do? How about the prospect of treatment?
How about testing outsourcing companies?
Complete interview questions for interviewers and senior Android engineers in front-line Internet enterprises
全网最全的低代码/无代码平台盘点:简道云、伙伴云、明道云、轻流、速融云、集简云、Treelab、钉钉·宜搭、腾讯云·微搭、智能云·爱速搭、百数云
浅浅的谈一下ThreadLocalInsecureRandom
Necessary skills for interview in large factories, 2022android will not die, I will not fall
秋招字节面试官问你还有什么问题?其实你已经踩雷了
随机推荐
C application interface development foundation - form control (6) - menu bar, toolbar and status bar controls
众昂矿业:2022年全球萤石行业市场供给现状分析
[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform
Is it safe for Anxin securities to open an account online?
字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
Fundamentals of shell programming (Chapter 9: loop)
SecureRandom那些事|真伪随机数
gst-launch的-v参数
安信证券在网上开户安全吗?
使用easyexcel模板导出的两个坑(Map空数据列错乱和不支持嵌套对象)
Parler de threadlocal insecurerandom
95后阿里P7晒出工资单:狠补了这个,真香...
Build your own website (16)
Debezium series: modify the source code to support drop foreign key if exists FK
Add data to excel small and medium-sized cases through poi
Analysis of openh264 decoded data flow
MMO project learning 1: preheating
浮动元素与父级、兄弟盒子的关系
Redis cluster simulated message queue
使用 RepositoryProvider简化父子组件的传值