vscode 编辑器go配置文件

本文详细介绍如何在VSCode中配置Go语言开发环境,包括自动保存、格式化、代码检查等设置,以及环境变量配置,如GOPATH和GOROOT路径设定。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

{
"files.autoSave": "afterDelay",
"go.buildOnSave": true,
"go.lintOnSave": true,
"go.vetOnSave": true,
"go.buildFlags": [],
"go.lintFlags": [],
"go.vetFlags": [],
"go.coverOnSave": false,
"go.useCodeSnippetsOnFunctionSuggest": false,
"go.formatOnSave": true,
"go.formatTool": "goreturns",
"go.goroot": "/usr/local/go",// 你的Goroot
"go.gopath": "/Users/wenjun/Mycode/Golang_code",
"git.autofetch": true,// 你的Gopath
}


export CLICOLOR=1
export GOPATH=/Users/wenjun/Mycode/Golang_code
export GOROOT=/usr/local/go
export REDIS=/usr/local/redis
export MYSQL=/usr/local/mysql
export LUA=~/Documents/Lua

export PATH=${PATH}:$GOROOT/bin:$GOPATH/bin:$REDIS/bin:$MYSQL/bin:$LUA/bin


" enable syntax highlighting
syntax enable


" show line numbers
set number


" set tabs to have 4 spaces
set ts=4


" indent when moving to the next line while writing code
set autoindent


" expand tabs into spaces
set expandtab


" when using the >> or << commands, shift lines by 4 spaces
set shiftwidth=4


" show a visual line under the cursor's current line
set cursorline


" show the matching part of the pair for [] {} and ()
set showmatch


" set color
set background=dark
colorscheme solarized


" enable all Python syntax highlighting features
let python_highlight_all = 1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值