vscode
配置go开发环境
安装go vscode git
设置windows用户环境变量
GOROOT:golang安装目录
GOPATH:存放sdk以外的第三方类库、收藏可复用的代码
GOPATH目录约定有三个子目录:src、pkg、bin。src存放源代码(比如:.go .c .h .s等) 按照golang默认约定,go run,go install等命令的当前工作路径(即在此路径下执行上述命令);pkg编译时生成的中间文件(比如:.a)golang编译包时;bin编译后生成的可执行文件(为了方便,可以把此目录加入到PATH变量中,如果有多个gopath,那么使用{GOPATH/bin:}/bin添加所有的bin目录)
配置go env
# 打开git bash,键入以下命令
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
vscode配置
# 安装扩展:go和code runner
# 键入ctrl+shift+p 搜:go:install/update
# 选择所有下拉框,点击确定开始安装
# vscode输出以下信息即完成
Tools environment: GOPATH=D:\Dev_Go\GoPath;D:\Dev_Go\workspace
Installing 7 tools at D:\Dev_Go\GoPath\bin;D:\Dev_Go\workspace\bin in module mode.
gotests
gomodifytags
impl
goplay
dlv
staticcheck
gopls
Installing github.com/cweill/gotests/gotests@latest (D:\Dev_Go\GoPath\bin\gotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags@latest (D:\Dev_Go\GoPath\bin\gomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl@latest (D:\Dev_Go\GoPath\bin\impl.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay@latest (D:\Dev_Go\GoPath\bin\goplay.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@latest (D:\Dev_Go\GoPath\bin\dlv.exe) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck@latest (D:\Dev_Go\GoPath\bin\staticcheck.exe) SUCCEEDED
Installing golang.org/x/tools/gopls@latest (D:\Dev_Go\GoPath\bin\gopls.exe) SUCCEEDED
All tools successfully installed. You are ready to Go. :)
设置背景图
安装扩展
- background
- Fix VSCode Checksums
配置背景图
打开 vscode 文件>首选项>设置>扩展>Plugin background config.backgroud插件配置>Style>在settings.json中编辑
// 背景设置配置 begin
"background.enabled": true, // 插件是否启动
"background.useDefault": false, // 是否使用默认图片
"background.customImages": [ // 在这里添加自己喜欢图片的路径,最多可添加3张图片
"file:///F:/backgroundImages/ny.jpg"
// "file:///F:/backgroundImages/wlop.png",
// "file:///F:/backgroundImages/小舞.jpg",
],
"background.style": {
"content": "''",
"pointer-events": "none",
"position": "absolute",
"z-index": "99999",
"width": "100%",
"height": "100%",
"background-position": "center",
"background-repeat": "no-repeat",
"background-size": "100%,100%",
"opacity": 0.5 // 背景图片的透明度设置
},
"diffEditor.ignoreTrimWhitespace": false,
"security.workspace.trust.untrustedFiles": "open",
"explorer.confirmDelete": false
// 背景设置配置 end
设置背景图后,Vscode标题栏出现【不受支持】提示的解决
按 ctrl + shift +p 输入以下命令,重启后就好了
Fix Checksums: Apply
本文来自博客园,作者:MegaloBox,转载请注明原文链接:https://www.cnblogs.com/cpw6/p/16285537.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了