mirror of
https://github.com/golang/go
synced 2024-11-23 10:30:03 -07:00
6c9e1c58bc
In a late change to golang.org/cl/320609, while going back and forth on the meaning of the boolean result value for "checkFlags", I got one of the cases wrong. As a result, rather than testing both default flags and -G=3, we were (redundanly) testing default flags and -G=0. I ran into this because in my local dev tree, I'm using types2 even for -G=0, and evidently one of the recent types2 CLs changed the error message in fixedbugs/issue10975.go. Fortunately, there haven't been any other regressions despite lacking test coverage. So this CL cleans things up a bit: 1. Fixes that test to use -lang=go1.17, so types2 reports the old error message again. 2. Renames "checkFlags" to "validForGLevel" so the boolean result is harder to get wrong. 3. Removes the blanket deny list of all -m tests, and instead adds the specific tests that are still failing. This effectively extends -G=3 coverage to another 27 tests that were using -m but already passing, so we can make sure they don't regress again. 4. Adds a -f flag to force running tests even if they're in the deny list, to make it easier to test whether they're still failing without having to edit run.go. Change-Id: I058d9d90d81a92189e54c6f591d95fb617fede53 Reviewed-on: https://go-review.googlesource.com/c/go/+/322612 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Griesemer <gri@golang.org>
19 lines
447 B
Go
19 lines
447 B
Go
// errorcheck -lang=go1.17
|
|
|
|
// 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.
|
|
|
|
// Issue 10975: Returning an invalid interface would cause
|
|
// `internal compiler error: getinarg: not a func`.
|
|
|
|
package main
|
|
|
|
type I interface {
|
|
int // ERROR "interface contains embedded non-interface|not an interface"
|
|
}
|
|
|
|
func New() I {
|
|
return struct{}{}
|
|
}
|