Skip to content

Instantly share code, notes, and snippets.

@m-bo-one
Created June 1, 2017 10:35
Show Gist options
  • Save m-bo-one/7301b5d63271bf0b2cd96e69a92ea8bd to your computer and use it in GitHub Desktop.
Save m-bo-one/7301b5d63271bf0b2cd96e69a92ea8bd to your computer and use it in GitHub Desktop.
GoSublime
{
// you may set specific environment variables here
// e.g "env": { "PATH": "$HOME/go/bin:$PATH" }
// in values, $PATH and ${PATH} are replaced with
// the corresponding environment(PATH) variable, if it exists.
"env": {"GOPATH": "$HOME/go", "PATH": "$PATH:$GOPATH/bin" },
"fmt_cmd": ["goimports"],
// enable comp-lint, this will effectively disable the live linter
"comp_lint_enabled": true,
// list of commands to run
"comp_lint_commands": [
// run `golint` on all files in the package
// "shell":true is required in order to run the command through your shell (to expand `*.go`)
// also see: the documentation for the `shell` setting in the default settings file ctrl+dot,ctrl+4
{"cmd": ["golint *.go"], "shell": true},
// run go vet on the package
{"cmd": ["go", "vet"]},
// check for errors
{"cmd": ["errcheck"]},
// report simolification for code
{"cmd": ["gosimple"]},
// semantic analysis
{"cmd": ["gotype"]},
// find un-optimally aligned structures
{"cmd": ["aligncheck"]},
// find unused structs
{"cmd": ["structcheck"]},
// find unused global vars
{"cmd": ["varcheck"]},
// find duplication code usage
{"cmd": ["dupl"]},
// find unused code
{"cmd": ["deadcode"]},
// run `go install` on the package. GOBIN is set,
// so `main` packages shouldn't result in the installation of a binary
{"cmd": ["go", "install"]}
],
"on_save": [
// run comp-lint when you save,
// naturally, you can also bind this command `gs_comp_lint`
// to a key binding if you want
{"cmd": "gs_comp_lint"}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment