1
0
mirror of https://github.com/amix/vimrc synced 2025-07-07 00:15:00 +08:00

Add support with Go language.

This commit is contained in:
Kurtis Moxley
2022-05-27 20:16:55 +08:00
parent 71e3f2fa49
commit de80db5969
205 changed files with 29172 additions and 0 deletions

View File

@ -0,0 +1,3 @@
if !reflect.DeepEqual({{+got+}}, {{+want+}}) {
t.Errorf("\ngot: %#v\nwant: %#v\n", {{+~\~2+}}, {{+~\~2+}})
}

View File

@ -0,0 +1,3 @@
if err != nil {
return {{+err+}}
}

View File

@ -0,0 +1,4 @@
if err != nil {
t.Fatal(err)
}
{{++}}

View File

@ -0,0 +1,3 @@
if err != nil {
return errors.Wrap(err, "{{++}}")
}

View File

@ -0,0 +1,3 @@
// {{++}}
func {{+~\~1+}}() {
}

View File

@ -0,0 +1 @@
fmt.Printf("%#v\n", {{++}})

View File

@ -0,0 +1,3 @@
for i := 0; i < {{++}}; i++ {
{{++}}
}

View File

@ -0,0 +1,2 @@
// Package {{+~expand('%:p:h:t')+}} {{++}}
package {{+~\~2+}}

View File

@ -0,0 +1,2 @@
fmt.Sprintf("{{++}}", {{++}})

View File

@ -0,0 +1,17 @@
var tests = []struct {
name string
expected string
given string
}{
{"", "", "",},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T){
actual := {{++}}(tt.given)
if actual != tt.expected {
t.Errorf("{{+~\~1+}}(%s): expected %s, actual %s", tt.given, tt.expected, actual)
}
})
}