diff --git a/golang/install.sh b/golang/install.sh index 5427c8464..a2f9f58ef 100755 --- a/golang/install.sh +++ b/golang/install.sh @@ -1,12 +1,16 @@ #!/bin/sh -if [ "$(which go)" ] && [ ! -z "$GOPATH" ]; then +if [ "$(which go)" ] && [ -n "$GOPATH" ]; then mkdir -p "$GOPATH/bin" "$GOPATH/src/github.com/" packages=" github.com/alecthomas/gometalinter golang.org/x/tools/cmd/cover golang.org/x/tools/cmd/godoc + github.com/nsf/gocode + golang.org/x/tools/cmd/guru golang.org/x/tools/cmd/goimports + golang.org/x/tools/cmd/gorename + github.com/golang/lint/golint " for pkg in $packages; do diff --git a/sublime-text-3/GoSublime.sublime-settings b/sublime-text-3/GoSublime.sublime-settings index 3a1c0732d..5fbf2d4eb 100644 --- a/sublime-text-3/GoSublime.sublime-settings +++ b/sublime-text-3/GoSublime.sublime-settings @@ -1,5 +1,40 @@ { - "env": { - "GOPATH": "$HOME/Code/Go" - } + "autocomplete_suggest_imports": true, + "comp_lint_commands": [ + { + "cmd": [ + "goimports -w $_fn" + ], + "shell": true + }, + { + "cmd": [ + "golint $_fn" + ], + "shell": true + }, + { + "cmd": [ + "go", + "vet" + ] + } + ], + "comp_lint_enabled": true, + "env": { + "GOPATH": "$HOME/Code/Go:/usr/bin/go", + "PATH": "$HOME/Code/Go/bin:$PATH:/usr/bin" + }, + "fmt_cmd": [ + "gofmt", + "-s" + ], + "on_save": [ + { + "cmd": "gs_comp_lint" + }, + { + "cmd": "go install" + } + ] }