.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / simple / testdata / src / CheckRedundantReturn / LintRedundantReturn.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/simple/testdata/src/CheckRedundantReturn/LintRedundantReturn.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/simple/testdata/src/CheckRedundantReturn/LintRedundantReturn.go
new file mode 100644 (file)
index 0000000..410eea2
--- /dev/null
@@ -0,0 +1,40 @@
+package pkg
+
+func fn1() {
+       return // want `redundant return`
+}
+
+func fn2(a int) {
+       return // want `redundant return`
+}
+
+func fn3() int {
+       return 3
+}
+
+func fn4() (n int) {
+       return
+}
+
+func fn5(b bool) {
+       if b {
+               return
+       }
+}
+
+func fn6() {
+       return
+       println("foo")
+}
+
+func fn7() {
+       return
+       println("foo")
+       return // want `redundant return`
+}
+
+func fn8() {
+       _ = func() {
+               return // want `redundant return`
+       }
+}