当前位置:网站首页>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
边栏推荐
- Common operators and operator priority
- What is the core value of testing?
- 【硬核干货】数据分析哪家强?选Pandas还是选SQL
- No matter how busy you are, you can't forget safety
- That's awesome. It's enough to read this article
- Worthy of being a boss, byte Daniel spent eight months on another masterpiece
- Is it safe for Guohai Securities to open an account online?
- 力扣 729. 我的日程安排表 I
- 淺淺的談一下ThreadLocalInsecureRandom
- aggregate
猜你喜欢
完爆面试官,一线互联网企业高级Android工程师面试题大全
How to choose the notion productivity tools? Comparison and evaluation of notion, flowus and WOLAI
What do software test engineers do? How about the prospect of treatment?
软件测试是干什么的?学习有啥要求?
MMO项目学习一:预热
Common - Hero Minesweeper
测试外包公司怎么样?
ACM getting started Day1
webuploader文件上传 拖拽上传 进度监听 类型控制 上传结果监听控件
如何安全快速地从 Centos迁移到openEuler
随机推荐
如何安全快速地从 Centos迁移到openEuler
Debezium series: modify the source code to support UNIX_ timestamp() as DEFAULT value
使用easyexcel模板导出的两个坑(Map空数据列错乱和不支持嵌套对象)
The difference between ID selector and class selector
Debezium series: record the messages parsed by debezium and the solutions after the MariaDB database deletes multiple temporary tables
Zhongang Mining: analysis of the current market supply situation of the global fluorite industry in 2022
Reinforcement learning - learning notes 4 | actor critical
Based on vs2017 and cmake GUI configuration, zxing and opencv are used in win10 x64 environment, and simple detection of data matrix code is realized
完爆面试官,一线互联网企业高级Android工程师面试题大全
爬虫练习题(二)
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
ACM getting started Day1
third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl
Build your own website (16)
C - sequential structure
Common operators and operator priority
Postman核心功能解析-参数化和测试报告
使用 RepositoryProvider简化父子组件的传值
深度学习 卷积神经网络(CNN)基础
14. Users, groups, and permissions (14)