forked from golang/vscode-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
754 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
# Prereqs Tools | ||
|
||
- gorename: go get golang.org/x/tools/cmd/gorename | ||
- gocode: go get -u github.com/nsf/gocode | ||
- goreturns: go get -u sourcegraph.com/sqs/goreturns | ||
- godef: go get -v github.com/rogpeppe/godef | ||
- golint: go get -u github.com/golang/lint/golint | ||
|
||
|
||
|
||
|
||
- gorename: `go get golang.org/x/tools/cmd/gorename` | ||
- gocode: `go get -u github.com/nsf/gocode` | ||
- goreturns: `go get -u sourcegraph.com/sqs/goreturns` | ||
- godef: `go get -v github.com/rogpeppe/godef` | ||
- golint: `go get -u github.com/golang/lint/golint` | ||
- go-find-references: `go get -v github.com/redefiance/go-find-references` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
{ | ||
".source.go": { | ||
"package clause": { | ||
"prefix": "pkg", | ||
"body": "package ${1:name}" | ||
}, | ||
"single import": { | ||
"prefix": "im", | ||
"body": "import \"${1:package}\"" | ||
}, | ||
"multiple imports": { | ||
"prefix": "ims", | ||
"body": "import (\n\t\"${1:package}\"\n)" | ||
}, | ||
"single constant": { | ||
"prefix": "co", | ||
"body": "const ${1:name} = ${2:value}" | ||
}, | ||
"multiple constants": { | ||
"prefix": "cos", | ||
"body": "const (\n\t${1:name} = ${2:value}\n)" | ||
}, | ||
"type interface declaration": { | ||
"prefix": "tyi", | ||
"body": "type ${1:name} interface {\n\t$0\n}" | ||
}, | ||
"type struct declaration": { | ||
"prefix": "tys", | ||
"body": "type ${1:name} struct {\n\t$0\n}" | ||
}, | ||
"main function": { | ||
"prefix": "main", | ||
"body": "func main() {\n\t$0\n}" | ||
}, | ||
"function declaration": { | ||
"prefix": "func", | ||
"body": "func $1($2) $3 {\n\t$0\n}" | ||
}, | ||
"variable declaration": { | ||
"prefix": "var", | ||
"body": "var ${1:name} ${2:type}" | ||
}, | ||
"switch statement": { | ||
"prefix": "switch", | ||
"body": "switch ${1:expression} {\ncase ${2:condition}:\n\t$0\n}" | ||
}, | ||
"case clause": { | ||
"prefix": "cs", | ||
"body": "case ${1:condition}:$0" | ||
}, | ||
"for statement": { | ||
"prefix": "for", | ||
"body": "for ${1:index} := 0; $1 < ${2:count}; $1${3:++} {\n\t$0\n}" | ||
}, | ||
"for range statement": { | ||
"prefix": "forr", | ||
"body": "for ${1:var} := range ${2:var} {\n\t$0\n}" | ||
}, | ||
"channel declaration": { | ||
"prefix": "ch", | ||
"body": "chan ${1:type}" | ||
}, | ||
"map declaration": { | ||
"prefix": "map", | ||
"body": "map[${1:type}]${2:type}" | ||
}, | ||
"empty interface": { | ||
"prefix": "in", | ||
"body": "interface{}" | ||
}, | ||
"if statement": { | ||
"prefix": "if", | ||
"body": "if ${1:condition} {\n\t$0\n}" | ||
}, | ||
"else branch": { | ||
"prefix": "el", | ||
"body": "else {\n\t$0\n}" | ||
}, | ||
"if else statement": { | ||
"prefix": "ie", | ||
"body": "if ${1:condition} {\n\t$2\n} else {\n\t$0\n}" | ||
}, | ||
"if err != nil": { | ||
"prefix": "iferr", | ||
"body": "if err != nil {\n\t${1:return}\n}" | ||
}, | ||
"fmt.Println": { | ||
"prefix": "fp", | ||
"body": "fmt.Println(\"$1\")" | ||
}, | ||
"fmt.Printf": { | ||
"prefix": "ff", | ||
"body": "fmt.Printf(\"$1\", ${2:var})" | ||
}, | ||
"log.Println": { | ||
"prefix": "lp", | ||
"body": "log.Println(\"$1\")" | ||
}, | ||
"log.Printf": { | ||
"prefix": "lf", | ||
"body": "log.Printf(\"$1\", ${2:var})" | ||
}, | ||
"log variable content": { | ||
"prefix": "lv", | ||
"body": "log.Printf(\"${1:var}: %#+v\\\\n\", ${1:var})" | ||
}, | ||
"make(...)": { | ||
"prefix": "make", | ||
"body": "make(${1:type}, ${2:0})" | ||
}, | ||
"new(...)": { | ||
"prefix": "new", | ||
"body": "new(${1:type})" | ||
}, | ||
"panic(...)": { | ||
"prefix": "pn", | ||
"body": "panic(\"$0\")" | ||
}, | ||
"http ResponseWriter *Request": { | ||
"prefix": "wr", | ||
"body": "${1:w} http.ResponseWriter, ${2:r} *http.Request" | ||
}, | ||
"http.HandleFunc": { | ||
"prefix": "hf", | ||
"body": "${1:http}.HandleFunc(\"${2:/}\", ${3:handler})" | ||
}, | ||
"http handler declaration": { | ||
"prefix": "hand", | ||
"body": "func $1(${2:w} http.ResponseWriter, ${3:r} *http.Request) {\n\t$0\n}" | ||
}, | ||
"http.Redirect": { | ||
"prefix": "rd", | ||
"body": "http.Redirect(${1:w}, ${2:r}, \"${3:/}\", ${4:http.StatusFound})" | ||
}, | ||
"http.Error": { | ||
"prefix": "herr", | ||
"body": "http.Error(${1:w}, ${2:err}.Error(), ${3:http.StatusInternalServerError})" | ||
}, | ||
"http.ListenAndServe": { | ||
"prefix": "las", | ||
"body": "http.ListenAndServe(\"${1::8080}\", ${2:nil})" | ||
}, | ||
"http.Serve": { | ||
"prefix": "sv", | ||
"body": "http.Serve(\"${1::8080}\", ${2:nil})" | ||
}, | ||
"goroutine anonymous function": { | ||
"prefix": "go", | ||
"body": "go func($1) {\n\t$2\n}($0)" | ||
}, | ||
"goroutine function": { | ||
"prefix": "gf", | ||
"body": "go ${1:func}($0)" | ||
}, | ||
"defer statement": { | ||
"prefix": "df", | ||
"body": "defer ${1:func}($0)" | ||
}, | ||
"test function": { | ||
"prefix": "tf", | ||
"body": "func Test$1(t *testing.T) {\n\t$0\n}" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.