aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/analysis/unusedparams/testdata/src/a/a.go.golden
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-16 14:15:45 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-03-16 14:15:45 +0000
commitcd3c7908c2ca750b27d330b4d257edc6818c4a5d (patch)
tree194d7b0e539d014393564a256bec571e18d6533a /gopls/internal/lsp/analysis/unusedparams/testdata/src/a/a.go.golden
parent3225eca48f7ce16eb31b2dd5a170806c1214a49e (diff)
parent09c5a32afc5b66f28f166a68afe1fc71afbf9b73 (diff)
downloadgolang-x-tools-build-tools-release.tar.gz
Snap for 9757917 from 09c5a32afc5b66f28f166a68afe1fc71afbf9b73 to build-tools-releasebuild-tools-release
Change-Id: If48e809642d94de846f47e34b88e446095e21aa5
Diffstat (limited to 'gopls/internal/lsp/analysis/unusedparams/testdata/src/a/a.go.golden')
-rw-r--r--gopls/internal/lsp/analysis/unusedparams/testdata/src/a/a.go.golden55
1 files changed, 55 insertions, 0 deletions
diff --git a/gopls/internal/lsp/analysis/unusedparams/testdata/src/a/a.go.golden b/gopls/internal/lsp/analysis/unusedparams/testdata/src/a/a.go.golden
new file mode 100644
index 000000000..e28a6bdea
--- /dev/null
+++ b/gopls/internal/lsp/analysis/unusedparams/testdata/src/a/a.go.golden
@@ -0,0 +1,55 @@
+// Copyright 2022 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"
+ "fmt"
+ "net/http"
+)
+
+type parent interface {
+ n(f bool)
+}
+
+type yuh struct {
+ a int
+}
+
+func (y *yuh) n(f bool) {
+ for i := 0; i < 10; i++ {
+ fmt.Println(i)
+ }
+}
+
+func a(i1 int, _ int, i3 int) int { // want "potentially unused parameter: 'i2'"
+ i3 += i1
+ _ = func(_ int) int { // want "potentially unused parameter: 'z'"
+ _ = 1
+ return 1
+ }
+ return i3
+}
+
+func b(_ bytes.Buffer) { // want "potentially unused parameter: 'c'"
+ _ = 1
+}
+
+func z(_ http.ResponseWriter, _ *http.Request) { // want "potentially unused parameter: 'h'"
+ fmt.Println("Before")
+}
+
+func l(h http.Handler) http.Handler {
+ return http.HandlerFunc(z)
+}
+
+func mult(a, _ int) int { // want "potentially unused parameter: 'b'"
+ a += 1
+ return a
+}
+
+func y(a int) {
+ panic("yo")
+}