github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/stylecheck/st1022/testdata/src/example.com/CheckExportedVarDocs/CheckExportedVarDocs.go (about) 1 package pkg 2 3 // Whatever 4 var a int 5 6 // Whatever //@ diag(`should be of the form`) 7 var B int 8 9 // Whatever 10 var ( 11 // Whatever 12 C int 13 ) 14 15 func fn() { 16 // Whatever 17 var D int 18 _ = D 19 } 20 21 // 22 var E int // this is fine, because "no comment" and "empty comment" are treated the same 23 24 // 25 // F is amazing. 26 // 27 // godoc allows this style, because ast.CommentGroup.Text strips whitespace. 28 // We currently make no effort to flag it. 29 // 30 var F int 31 32 //some:directive 33 var G int // we pretend that directives aren't part of the doc string, just like godoc in Go 1.15+ does 34 35 //some:directive 36 // H is amazing 37 var H int 38 39 //some:directive //@ diag(`should be of the form`) 40 // Whatever 41 var I int