Use the 1.17 compiler error message.
Change-Id: Ic62de5bfc9681674069934afc590f5840729f8e2
Reviewed-on: https://go-review.googlesource.com/c/go/+/396297
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
// We have a method with name f.Name.
name := f.Name.Value
if name == "_" {
- if check.conf.CompilerErrorMessages {
- check.error(f.Name, "methods must have a unique non-blank name")
- } else {
- check.error(f.Name, "invalid method name _")
- }
+ check.error(f.Name, "methods must have a unique non-blank name")
continue // ignore
}
// interfaces may not have any blank methods
type BlankI interface {
- _ /* ERROR "invalid method name" */ ()
- _ /* ERROR "invalid method name" */ (float32) int
+ _ /* ERROR "methods must have a unique non-blank name" */ ()
+ _ /* ERROR "methods must have a unique non-blank name" */ (float32) int
m()
}
// We have a method with name f.Names[0].
name := f.Names[0]
if name.Name == "_" {
- check.errorf(name, _BlankIfaceMethod, "invalid method name _")
+ check.errorf(name, _BlankIfaceMethod, "methods must have a unique non-blank name")
continue // ignore
}
// interfaces may not have any blank methods
type BlankI interface {
- _ /* ERROR "invalid method name" */ ()
- _ /* ERROR "invalid method name" */ (float32) int
+ _ /* ERROR "methods must have a unique non-blank name" */ ()
+ _ /* ERROR "methods must have a unique non-blank name" */ (float32) int
m()
}