mirror of https://github.com/databricks/cli.git
104 lines
1.8 KiB
Plaintext
104 lines
1.8 KiB
Plaintext
{
|
|
// https://snippet-generator.app/
|
|
"Test case": {
|
|
"scope": "go",
|
|
"prefix": "te",
|
|
"body": [
|
|
"func Test$1(t *testing.T) {",
|
|
" $2",
|
|
"}"
|
|
],
|
|
"description": "Test case"
|
|
},
|
|
"Assert len": {
|
|
"scope": "go",
|
|
"prefix": "al",
|
|
"body": [
|
|
"assert.Len(t, $1, $2)"
|
|
],
|
|
"description": "Assert len"
|
|
},
|
|
"Method with single error result": {
|
|
"scope": "go",
|
|
"prefix": "me",
|
|
"body": [
|
|
"func (a $1) $2() error {",
|
|
" return nil",
|
|
"}"
|
|
],
|
|
"description": "Method with single error result"
|
|
},
|
|
"if err != nil return err": {
|
|
"scope": "go",
|
|
"prefix": "ife",
|
|
"body": [
|
|
"if err != nil {",
|
|
" return err",
|
|
"}"
|
|
],
|
|
"description": "if err != nil return err"
|
|
},
|
|
"if _ == nil return fmt.Errorf()": {
|
|
"scope": "go",
|
|
"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",
|
|
"prefix": "iferrs",
|
|
"body": [
|
|
"if err != nil {",
|
|
" return \"\", err",
|
|
"}"
|
|
],
|
|
"description": "if err != nil return ``, err"
|
|
},
|
|
"assert.EqualError": {
|
|
"scope": "go",
|
|
"prefix": "aee",
|
|
"body": [
|
|
"assert.EqualError(t, err, \"..\")"
|
|
],
|
|
"description": "assert.EqualError"
|
|
},
|
|
"assert.Equal": {
|
|
"scope": "go",
|
|
"prefix": "ae",
|
|
"body": [
|
|
"assert.Equal(t, \"..\", $1)"
|
|
],
|
|
"description": "assert.Equal"
|
|
},
|
|
"assert.NoError": {
|
|
"scope": "go",
|
|
"prefix": "anoe",
|
|
"body": [
|
|
"assert.NoError(t, err)"
|
|
],
|
|
"description": "assert.NoError"
|
|
},
|
|
"err :=": {
|
|
"scope": "go",
|
|
"prefix": "e",
|
|
"body": [
|
|
"err := "
|
|
],
|
|
"description": "err :="
|
|
},
|
|
"Golang Error Wrapper": {
|
|
"scope": "go",
|
|
"prefix": "ifew",
|
|
"body": [
|
|
"if err != nil {",
|
|
" return fmt.Errorf(\"$1: %w\", err)",
|
|
"}$2"
|
|
],
|
|
"description": "Golang Error Wrapper"
|
|
}
|
|
}
|