added basic go mnemonics for vscode

This commit is contained in:
Serge Smertin 2022-05-14 19:55:19 +02:00
parent 1029244390
commit 77198bdfd0
1 changed files with 83 additions and 0 deletions

83
.vscode/testing.code-snippets vendored Normal file
View File

@ -0,0 +1,83 @@
{
// https://snippet-generator.app/
"Test case": {
"prefix": "te",
"body": [
"func Test$1(t *testing.T) {",
" $2",
"}"
],
"description": "Test case"
},
"Assert len": {
"prefix": "al",
"body": [
"assert.Len(t, $1, $2)"
],
"description": "Assert len"
},
"Method with single error result": {
"prefix": "me",
"body": [
"func (a $1) $2() error {",
" return nil",
"}"
],
"description": "Method with single error result"
},
"if err != nil return err": {
"prefix": "ife",
"body": [
"if err != nil {",
" return err",
"}"
],
"description": "if err != nil return err"
},
"if _ == nil return fmt.Errorf()": {
"prefix": "ifne",
"body": [
"if $1 == nil {",
" return fmt.Errorf(\"$2 is not defined\")",
"}"
],
"description": "if _ == nil return fmt.Errorf()"
},
"if err != nil return ``, err": {
"prefix": "iferrs",
"body": [
"if err != nil {",
" return \"\", err",
"}"
],
"description": "if err != nil return ``, err"
},
"assert.EqualError": {
"prefix": "aee",
"body": [
"assert.EqualError(t, err, \"..\")"
],
"description": "assert.EqualError"
},
"assert.Equal": {
"prefix": "ae",
"body": [
"assert.Equal(t, \"..\", $1)"
],
"description": "assert.Equal"
},
"assert.NoError": {
"prefix": "anoe",
"body": [
"assert.NoError(t, err)"
],
"description": "assert.NoError"
},
"err :=": {
"prefix": "e",
"body": [
"err := "
],
"description": "err :="
}
}