.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.1.0 / go / analysis / passes / unusedresult / testdata / src / a / a.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/go/analysis/passes/unusedresult/testdata/src/a/a.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.1.0/go/analysis/passes/unusedresult/testdata/src/a/a.go
new file mode 100644 (file)
index 0000000..50b2f56
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package a
+
+import (
+       "bytes"
+       "errors"
+       "fmt"
+)
+
+func _() {
+       fmt.Errorf("") // want "result of fmt.Errorf call not used"
+       _ = fmt.Errorf("")
+
+       errors.New("") // want "result of errors.New call not used"
+
+       err := errors.New("")
+       err.Error() // want `result of \(error\).Error call not used`
+
+       var buf bytes.Buffer
+       buf.String() // want `result of \(bytes.Buffer\).String call not used`
+
+       fmt.Sprint("")  // want "result of fmt.Sprint call not used"
+       fmt.Sprintf("") // want "result of fmt.Sprintf call not used"
+}