

Go语言开发环境配置(VSCode)
source link: https://studygolang.com/articles/13828?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

安装go
略
安装git
略
VS Code配置
-
1.安装go扩展
在vscode扩展中搜“go”,选择microsoft官方的ms-vscode.go
-
2.安装相关工具包
-
通过VSCode安装
操作很简单,但需要科学上网(见下面第4条)- 1)Ctrl + Shift + P
-
2)输入
Go: install/update tools
- 3)All Select,确定
-
4)部分工具需要科学上网。注意为VSCode设置[用户设置]http代理:
此处以SSR为例,请先安装并完成SSR客户端配置- 4.1) windows下先启动SSR客户端,再对VSCode设置:
"http.proxy": "127.0.0.1:1080",
- 4.2) linux下需要 使用privoxy 一类的工具,安装配置好privoxy之后,再设置VSCode
"http.proxy": "http://localhost:8118/",
注:因为要跑本地服务,因此需要去掉Privoxy/config中# forward localhost/ .
注释forward localhost/ .
-
手动安装
-
使用go get,例如:
go get -u github.com/gin-gonic/gin
部分包需要科学上网,可参考前面科学上网说明 -
不想翻墙的安装方法
# 注意,github下golang/镜像中的包需要放到golang.org/x目录下 git clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/net git clone https://github.com/golang/sys.git $GOPATH/src/golang.org/x/sys git clone https://github.com/golang/tools.git $GOPATH/src/golang.org/x/tools
-
使用go get,例如:
-
通过VSCode安装
-
3.配置
-
设置toolsGopath(原因参考 vscode golang详细配置
中的【 注:坑点
】)
在VSCode[用户设置]中添加:"go.toolsGopath": "F:\\SourceCode\\go",
-
debug配置
使用默认配置
debug配置的更多信息,参考官方Wiki: Debugging Go code using VS Code
-
设置toolsGopath(原因参考 vscode golang详细配置
中的【 注:坑点
】)
Recommend
-
46
下载 Golang 因为 Homebrew 的存在,在 Mac 上下载什么都很方便。可以运行以下的命令安装 Homebrew : /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
28
ubuntu系统安装Go和liteide及环境配置 一、通过apt-get安装 1、安装 sudo apt-get install golang 2、设置GOPATH变量 GOPATH是扩展库的目录,Go先搜索...
-
35
vscode 内核开发环境配置In DEV By Rapiz 2021-02-03 Linux Linux,内核,开发环境,自动补全,vscode内核模块是用 Makefile 作为编译...
-
6
VSCode 前端开发环境安装及配置 兰玉磊 • 2020年7月9日 00:11 • Web • 阅读 6877开发工具介绍HBuilder
-
9
以下代码使用 Windows Powershell 执行 安装 Scoop # PowerShell must be allowed to execute local scripts for your user account Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser #...
-
6
这两天一直在用PHPstudy+Vscode配置php开发环境,膜拜过许许多多网上师傅的博客,发现方式多样,但是版本不一致,导致了配置存在问题,利用我课间20分钟时间,就这今天我遇见的问题,以及搭建过程进行简要概括!希望对大家有帮助! 首先到官网上自...
-
11
VSCode开发环境配置 先到VSCode官网去下载适合自己系统的VSCode安装软件 VScode下载地址:ht...
-
1
在 Windows 环境下使用 VSCode 和 Go 语言开发 STM32 STM32和Arduino相比,要配置的东西多一些 安装 Go 语言编译器、TinyGo 编译器、配置 VSCode:参考
-
6
下载与安装 访问Golang官网的下载链接,可以直接下载安装包,访问地址为:https://go.dev/dl/
-
8
VsCode搭建C语言运行环境以及终端乱码问题解决 在VsCode中...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK