macOS-go语言安装与vscode配置

1、通过brew安装

$ brew install [email protected]

2、为了避免发生国内访问问题,配置go的代理

$ go env -w GOPROXY=https://goproxy.cn

3、在vscode中安装go插件和工具

参考:3.安装 Go 扩展 - 配置 Visual Studio Code for Go 开发

4、测试

参考:5.编写示例 Go 程序 - 配置 Visual Studio Code for Go 开发

在根目录下建立模块 sample-app,在模块中添加文件 sample-app/main.go

点击 运行 - 启动,如果正常断点,那就说明配置ok了,开始go的开发吧。 

5、参考

VScode下配置Go语言开发环境【2023最新】_vscode go_迈克柯里喵的博客-CSDN博客

配置 Visual Studio Code for Go 开发 - Go on Azure | Microsoft Learn

猜你喜欢

转载自blog.csdn.net/tirestay/article/details/134519457