Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / stylecheck / testdata / src / CheckNames / CheckNames.go
1 // Package pkg_foo ...
2 package pkg_foo // want `should not use underscores in package names`
3
4 var range_ int
5 var _abcdef int
6 var abcdef_ int
7 var abc_def int  // want `should not use underscores in Go names; var abc_def should be abcDef`
8 var abc_def_ int // want `should not use underscores in Go names; var abc_def_ should be abcDef_`
9
10 func fn_1()  {} // want `func fn_1 should be fn1`
11 func fn2()   {}
12 func fn_Id() {} // want `func fn_Id should be fnID`
13 func fnId()  {} // want `func fnId should be fnID`
14
15 var FOO_BAR int // want `should not use ALL_CAPS in Go names; use CamelCase instead`
16 var Foo_BAR int // want `var Foo_BAR should be FooBAR`
17 var foo_bar int // want `foo_bar should be fooBar`
18 var kFoobar int // not a check we inherited from golint. more false positives than true ones.
19
20 func fn(x []int) {
21         var (
22                 a_b = 1 // want `var a_b should be aB`
23                 c_d int // want `var c_d should be cD`
24         )
25         a_b += 2
26         for e_f := range x { // want `range var e_f should be eF`
27                 _ = e_f
28         }
29
30         _ = a_b
31         _ = c_d
32 }
33
34 //export fn_3
35 func fn_3() {}
36
37 //export not actually the export keyword
38 func fn_4() {} // want `func fn_4 should be fn4`
39
40 //export
41 func fn_5() {} // want `func fn_5 should be fn5`
42
43 // export fn_6
44 func fn_6() {} // want `func fn_6 should be fn6`
45
46 //export fn_8
47 func fn_7() {} // want `func fn_7 should be fn7`
48
49 //go:linkname fn_8 time.Now
50 func fn_8() {}