.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / 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 var _1000 int // issue 858
21
22 func fn(x []int) {
23         var (
24                 a_b = 1 // want `var a_b should be aB`
25                 c_d int // want `var c_d should be cD`
26         )
27         a_b += 2
28         for e_f := range x { // want `range var e_f should be eF`
29                 _ = e_f
30         }
31
32         _ = a_b
33         _ = c_d
34 }
35
36 //export fn_3
37 func fn_3() {}
38
39 //export not actually the export keyword
40 func fn_4() {} // want `func fn_4 should be fn4`
41
42 //export
43 func fn_5() {} // want `func fn_5 should be fn5`
44
45 // export fn_6
46 func fn_6() {} // want `func fn_6 should be fn6`
47
48 //export fn_8
49 func fn_7() {} // want `func fn_7 should be fn7`
50
51 //go:linkname fn_8 time.Now
52 func fn_8() {}