databricks-cli/.vscode/testing.code-snippets

104 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2022-05-14 17:55:19 +00:00
{
// https://snippet-generator.app/
"Test case": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "te",
"body": [
"func Test$1(t *testing.T) {",
" $2",
"}"
],
"description": "Test case"
},
"Assert len": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "al",
"body": [
"assert.Len(t, $1, $2)"
],
"description": "Assert len"
},
"Method with single error result": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "me",
"body": [
"func (a $1) $2() error {",
" return nil",
"}"
2022-05-14 17:55:19 +00:00
],
"description": "Method with single error result"
},
2022-05-14 17:55:19 +00:00
"if err != nil return err": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "ife",
"body": [
"if err != nil {",
" return err",
"}"
],
"description": "if err != nil return err"
},
"if _ == nil return fmt.Errorf()": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "ifne",
"body": [
"if $1 == nil {",
" return fmt.Errorf(\"$2 is not defined\")",
"}"
],
"description": "if _ == nil return fmt.Errorf()"
},
"if err != nil return ``, err": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "iferrs",
"body": [
"if err != nil {",
" return \"\", err",
"}"
],
"description": "if err != nil return ``, err"
},
"assert.EqualError": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "aee",
"body": [
"assert.EqualError(t, err, \"..\")"
2022-05-14 17:55:19 +00:00
],
"description": "assert.EqualError"
},
"assert.Equal": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "ae",
"body": [
"assert.Equal(t, \"..\", $1)"
2022-05-14 17:55:19 +00:00
],
"description": "assert.Equal"
},
"assert.NoError": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "anoe",
"body": [
"assert.NoError(t, err)"
2022-05-14 17:55:19 +00:00
],
"description": "assert.NoError"
},
"err :=": {
"scope": "go",
2022-05-14 17:55:19 +00:00
"prefix": "e",
"body": [
"err := "
2022-05-14 17:55:19 +00:00
],
"description": "err :="
},
"Golang Error Wrapper": {
"scope": "go",
"prefix": "ifew",
"body": [
"if err != nil {",
" return fmt.Errorf(\"$1: %w\", err)",
"}$2"
],
"description": "Golang Error Wrapper"
}
}