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

83 lines
1.5 KiB
Plaintext

{
// 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 :="
}
}