mirror of
https://github.com/golang/go.git
synced 2025-05-12 11:04:11 +00:00
Use quotes to wrap user-supplied token in the syntax error message. Updates #65790 Change-Id: I631a63df4a6bb8615b7850a324d812190bc15f30 GitHub-Last-Rev: f291e1d5a6adee558d21bb7e0a3a17471bad7eb6 GitHub-Pull-Request: golang/go#65840 Reviewed-on: https://go-review.googlesource.com/c/go/+/565518 Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
18 lines
382 B
Go
18 lines
382 B
Go
// errorcheck
|
|
|
|
// Copyright 2018 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.
|
|
|
|
// Verify error messages for incorrect if/switch headers.
|
|
|
|
package p
|
|
|
|
func f() {
|
|
if f() true { // ERROR "unexpected `true', expected {"
|
|
}
|
|
|
|
switch f() true { // ERROR "unexpected `true', expected {"
|
|
}
|
|
}
|