aboutsummaryrefslogtreecommitdiff
path: root/test/typeswitch2b.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2022-09-21 14:25:34 -0700
committerGopher Robot <gobot@golang.org>2022-09-27 21:10:19 +0000
commit4360fd8d6fc6cd23f56b694a91ccf751896eb712 (patch)
treec0addd4e7b9efd461074cf404a59822a1a5dcca8 /test/typeswitch2b.go
parent871a3a409ac55fdcaf329596023e56be279b1950 (diff)
downloadgo-4360fd8d6fc6cd23f56b694a91ccf751896eb712.tar.gz
go-4360fd8d6fc6cd23f56b694a91ccf751896eb712.zip
go/types, types2: use "and not used" instead of "but not used" in error messages
This matches longstanding compiler behavior. Also, for unused packages, report: `"pkg" imported and not used` `"pkg" imported as X and not used` This matches the other `X declared and not used` errors. For #55326. Change-Id: Ie71cf662fb5f4648449c64fc51bede298a1bdcbf Reviewed-on: https://go-review.googlesource.com/c/go/+/432557 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com>
Diffstat (limited to 'test/typeswitch2b.go')
-rw-r--r--test/typeswitch2b.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/typeswitch2b.go b/test/typeswitch2b.go
index 6da0d5fa6e..135ae86cff 100644
--- a/test/typeswitch2b.go
+++ b/test/typeswitch2b.go
@@ -11,9 +11,9 @@ package main
func notused(x interface{}) {
// The first t is in a different scope than the 2nd t; it cannot
- // be accessed (=> declared but not used error); but it is legal
+ // be accessed (=> declared and not used error); but it is legal
// to declare it.
- switch t := 0; t := x.(type) { // ERROR "declared but not used"
+ switch t := 0; t := x.(type) { // ERROR "declared and not used"
case int:
_ = t // this is using the t of "t := x.(type)"
}