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 / unused / testdata / src / functions / functions.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/unused/testdata/src/functions/functions.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.0.1-2020.1.5/unused/testdata/src/functions/functions.go
new file mode 100644 (file)
index 0000000..cb74a89
--- /dev/null
@@ -0,0 +1,36 @@
+package main
+
+type state func() state
+
+func a() state {
+       return a
+}
+
+func main() {
+       st := a
+       _ = st()
+}
+
+type t1 struct{} // want `t1`
+type t2 struct{}
+type t3 struct{}
+
+func fn1() t1     { return t1{} } // want `fn1`
+func fn2() (x t2) { return }
+func fn3() *t3    { return nil }
+
+func fn4() {
+       const x = 1
+       const y = 2  // want `y`
+       type foo int // want `foo`
+       type bar int
+
+       _ = x
+       _ = bar(0)
+}
+
+func init() {
+       fn2()
+       fn3()
+       fn4()
+}