当前位置:网站首页>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
边栏推荐
- The difference between ID selector and class selector
- 常用运算符与运算符优先级
- Worthy of being a boss, byte Daniel spent eight months on another masterpiece
- MMO project learning 1: preheating
- 软件测试是干什么的?学习有啥要求?
- 字节跳动Dev Better技术沙龙成功举办,携手华泰分享Web研发效能提升经验
- 【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
- 【硬核干货】数据分析哪家强?选Pandas还是选SQL
- How to choose the notion productivity tools? Comparison and evaluation of notion, flowus and WOLAI
- 通过POI追加数据到excel中小案例
猜你喜欢
third-party dynamic library (libcudnn.so) that Paddle depends on is not configured correctl
如何安全快速地从 Centos迁移到openEuler
Android interview, Android audio and video development
力扣 729. 我的日程安排表 I
Interviewer: what is the internal implementation of set data types in redis?
What do software test engineers do? How about the prospect of treatment?
IBM has laid off 40 + year-old employees in a large area. Mastering these ten search skills will improve your work efficiency ten times
城链科技数字化创新战略峰会圆满召开
C#应用程序界面开发基础——窗体控制(5)——分组类控件
不愧是大佬,字节大牛耗时八个月又一力作
随机推荐
Inventory of the most complete low code / no code platforms in the whole network: Jiandao cloud, partner cloud, Mingdao cloud, Qingliu, xurong cloud, Jijian cloud, treelab, nailing · Yida, Tencent clo
How to safely and quickly migrate from CentOS to openeuler
That's awesome. It's enough to read this article
Autumn byte interviewer asked you any questions? In fact, you have stepped on thunder
Securerandom things | true and false random numbers
Fundamentals of shell programming (Part 8: branch statements -case in)
Float. The specific meaning of the return value of floattorawintbits is to convert float into byte array
【obs】libobs-winrt :CreateDispatcherQueueController
MMO項目學習一:預熱
随机数生成的四种方法|Random|Math|ThreadLocalRandom|SecurityRandom
acm入门day1
Recommended collection, my Tencent Android interview experience sharing
Is it safe to open a mobile stock account? Is it reliable?
Is it safe for Guohai Securities to open an account online?
IBM has laid off 40 + year-old employees in a large area. Mastering these ten search skills will improve your work efficiency ten times
selenium 元素信息
城链科技数字化创新战略峰会圆满召开
S7-200smart uses V90 Modbus communication control library to control the specific methods and steps of V90 servo
《乔布斯传》英文原著重点词汇笔记(十二)【 chapter ten & eleven】
What do software test engineers do? How about the prospect of treatment?