打开Sublime按下快捷键 Ctrl+Shift+P
,输入Package Control: Install Package
回车,在新弹出的输入栏中输入golang build
回车安装
打开菜单选择Tools > Build System > Go
按下快捷键 Ctrl+Shift+P
输入build with
即可使用
打开Sublime按下快捷键 Ctrl+Shift+P
,输入Package Control: Install Package
回车,在新弹出的输入栏中输入Gofmt
回车安装
在终端执行此命令
rem set GOPROXY=https://proxy.golang.org,direct
go get golang.org/x/tools/cmd/goimports
{
"cmds": [
["goimports"]
],
"format_on_save": true
}
原文:https://www.cnblogs.com/liy36/p/15062489.html