gofmt
安装软件包后,我在 Sublime Text 中不断收到此错误:
Traceback (most recent call last):
File "/Users/abrahma/Library/Application Support/Sublime Text 3/Installed Packages/Gofmt.sublime-package/gofmt.py", line 257, in run_formatter
formatter = Formatter(view)
File "/Users/abrahma/Library/Application Support/Sublime Text 3/Installed Packages/Gofmt.sublime-package/gofmt.py", line 166, in __init__
self.cmds = [Command(cmd, self.view, self.window) for cmd in cmds]
File "/Users/abrahma/Library/Application Support/Sublime Text 3/Installed Packages/Gofmt.sublime-package/gofmt.py", line 166, in <listcomp>
self.cmds = [Command(cmd, self.view, self.window) for cmd in cmds]
File "/Users/abrahma/Library/Application Support/Sublime Text 3/Installed Packages/Gofmt.sublime-package/gofmt.py", line 77, in __init__
self.window)
File "/Users/abrahma/Library/Application Support/Sublime Text 3/Packages/golangconfig/all/golangconfig.py", line 227, in subprocess_info
raise exception
golangconfig.EnvVarError: The following environment variable is currently unset: GOPATH
我的``文件有以下内容:
"env" : {
"GOPATH" : "/Users/abrahma/git/go",
"GOROOT" : "/usr/local/Cellar/go/1.12.7/libexec",
}
go env
(与我终端上的输出相匹配)
我还有一个golang.sublime-settings
包含以下内容的文件:
{
"env" : {
"GOPATH" : "/Users/abrahma/git/go",
"GOROOT" : "/usr/local/Cellar/go/1.12.7/libexec",
}
}
因此,出于某种原因,GOPATH
上述内容显然没有被采纳,有什么想法吗?