.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.1.1 / staticcheck / testdata / src / CheckPureFunctions / CheckPureFunctions_test.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckPureFunctions/CheckPureFunctions_test.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/honnef.co/go/tools@v0.1.1/staticcheck/testdata/src/CheckPureFunctions/CheckPureFunctions_test.go
new file mode 100644 (file)
index 0000000..71fe2fa
--- /dev/null
@@ -0,0 +1,22 @@
+package pkg
+
+import (
+       "strings"
+       "testing"
+)
+
+func TestFoo(t *testing.T) {
+       strings.Replace("", "", "", 1) // want `is a pure function but its return value is ignored`
+}
+
+func BenchmarkFoo(b *testing.B) {
+       strings.Replace("", "", "", 1)
+}
+
+func doBenchmark(s string, b *testing.B) {
+       strings.Replace("", "", "", 1)
+}
+
+func BenchmarkBar(b *testing.B) {
+       doBenchmark("", b)
+}