当前位置:网站首页>windows10:vscode下go语言的适配
windows10:vscode下go语言的适配
2022-07-17 14:55:00 【[虚幻私塾】】
优质资源分享
| 学习路线指引(点击解锁) | 知识定位 | 人群定位 |
|---|---|---|
| 🧡 Python实战微信订餐小程序 🧡 | 进阶级 | 本课程是python flask+微信小程序的完美结合,从项目搭建到腾讯云部署上线,打造一个全栈订餐系统。 |
| Python量化交易实战 | 入门级 | 手把手带你打造一个易扩展、更安全、效率更高的量化交易系统 |
ps:本篇依赖golang的sdk已经安装完成:
url:https://blog.csdn.net/mrwhite2020/p/16475731.html
一、下载vscode,选择windows最新版本
https://code.visualstudio.com/Download
默认按照user版本的64位机器选择:system installer和user installer的区别就在用于为所有用户/单用户安装。
二、安装vscode
默认选择对应的路径进行安装
ps:最好将以下两个选项勾选,以便之后使用起来比较方便,可以在右键菜单中增加vscode直接打开文件或文件夹的选项
添加path到环境变量默认会选择,勾选时不要去掉。
三、golang语言适配
1.选择打开文件夹并选择go脚本的目录
2.安装go扩展包
新建go脚本后,右下角提示是否安装go扩展,点击安装
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GQ2Qqm4i-1658032894294)()]
3.安装go语言插件
(1)点击运行和调试后,右下角出现需要安装go响应插件的提示:
安装插件可以自动提示变量和函数,且可以正确运行代码
(2)点击install插件时候:发现如下的问题
(3)此时在cmd设置go的环境变量参数:
go env -w GO111MODULE=auto
此时安装依然失败:
(4)修改go环境变量的镜像设置:
go env -w GOPROXY=https://goproxy.io,direct
此时会发现如下的错误:
Error: 无法解析不存在的文件 ‘d:\Go_WorkSpace\pkg\mod\go.mod’
(5)此时在GOPATH路径下执行以下命令初始化go-mod
go mod init
且安装依赖git来完成插件的安装,确保机器已经安装了git
(6)点击右下角的Analysis Tools Missing工具安装后:可以查看Go哪些插件没有安装成功
四、测试go代码调试:
控制台可正常打印结果
边栏推荐
- TiKV 线程池性能调优
- SPI service discovery mechanism
- Kunlunbase online meetup is waiting for you~
- Cmake common commands (V)
- 565. 数组嵌套 : 常规模拟题
- Docker install MySQL
- Leetcode 1310. 子数组异或查询
- 02-3、指针和引用的区别
- function/symbol ‘pango_context_set_round_glyph_positions‘ not found in library ‘libpango-1.0.so.0‘x
- Chapter 1 of creating virtual machine (vmvare virtual machine)
猜你喜欢

LeetCode刷题——查找和最小的 K 对数字#373#Medium

XSS. haozi. Me brush questions

02-3、指針和引用的區別

Leetcode 1304. N different integers with zero and

Introduction to common distributed locks

Research on Wenhua commodity index

【PostgreSQL 】PostgreSQL 15对distinct的优化

Limit query of MySQL optimization series

Leetcode 1252. 奇数值单元格的数目

Docker install MySQL
随机推荐
565. 数组嵌套 : 常规模拟题
Opencv draw a black rectangle and write the serial number
Leetcode 1252. 奇数值单元格的数目
Loj#2324-「清华集训 2017」小 Y 和二叉树
Sword finger offer II 041 Average value of sliding window
Introduction and Simulation Implementation of string class
Round table record: fireside dialogue -- how to realize innovation in Web3
【PostgreSQL 】PostgreSQL 15对distinct的优化
STM32F407 NVIC
An error, uncaught typeerror: modalfactory is not a constructor
TCP拥塞控制详解 | 7. 超越TCP
TCP congestion control details | 7 Surpass TCP
TCP拥塞控制详解 | 7. 超越TCP
Kunlunbase online meetup is waiting for you~
Leetcode 1252. Number of odd value cells
02-2. Default parameters, function overloading, reference, implicit type conversion, about error reporting
The type of MySQL index (single column index, combined index, BTREE index, clustered index, etc.)
A summary of C language pointer
cv02-roge矩阵,旋转向量 ,角度
Synchronized lock upgrade