Install Sublime Text 3
https://packagecontrol.io/installation#st3
Copy text
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
- Sublime Text > Ctrl+` 调出控制台, 执行上面网页中的 python代码安装 Package Control
- 在sublime中,按住快捷键 shift + ctrl + p,在弹出框中输入install package,并按下回车
- 接着,输入gosublime,并按下回车(可能需要稍微等待下,可以看sublime最下面的状态)
- gosublime安装完成后,点击菜单项Preferences -> package settings -> GoSublime -> Settings - Uesrs,配置GOPATH,GOROOT
- cmd.exe > go env
- set GOPATH=C:\Users\ricky\go
- set GOROOT=C:\Go
- gosublime安装完成后,点击菜单项Preferences -> package settings -> GoSublime -> Settings - Uesrs,配置GOPATH,GOROOT 在打开的窗口里输入如下内容,并保存
{
"env": {
"GOPATH": "C:/Users/ricky/go",
"GOROOT": "C:/Go"
}
}
配置(可选),点击菜单项Tools->Build System->New Build System,在打开的窗口里输入如下内容,并保存GoNewBuildSystem
{
"cmd": ["go", "run", "$file_name"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"working_dir": "$file_path",
"selector": "source.go"
}
https://www.cnblogs.com/simplelovecs/p/5311899.html
安装Golang
go语言主页:
go语言安装下载:
环境变量设置:
GOROOT:
GOROOT变量设置go安装的根目录,windows下,通常是 c:\go
GOPATH:
GOPATH变量设置go源代码存放的根目录
安装 Sublime Text3
首先,安装 Sublime Text 3:
接着,安装 Sublime Text 3 的 Package Control:
运行sublime text 3,按下快捷键 ctrl+` 调出控制台,执行上面网页中的 python代码安装 Package Control,然后重启sublime text 3。
最后,安装插件 GoSublime:
1)在sublime中,按住快捷键 shift + ctrl + p,在弹出框中输入install package,并按下回车
2)接着,输入gosublime,并按下回车(可能需要稍微等待下,可以看sublime最下面的状态)
3)gosublime安装完成后,点击菜单项Preferences -> package settings -> GoSublime -> Settings - Uesrs,配置GOPATH,GOROOT
在打开的窗口里输入如下内容,并保存
1
2
3
4
5
6
| { "env" : { "GOPATH" : "c:/go" , "GOROOT" : "d:/GoWorkspace" } } |
4)配置(可选),点击菜单项Tools->Build System->New Build System,在打开的窗口里输入如下内容,并保存
1
2
3
4
5
6
| { "cmd" : [ "go" , "run" , "$file_name" ], "file_regex" : "^[ ]*File \"(...*?)\", line ([0-9]*)" , "working_dir" : "$file_path" , "selector" : "source.go" } |
其他参考: