Add early detection of cases where no wrapper is necessary because the value type already implements the target interface. It should both increase performances by avoiding the wrapper overhead, and fix errors due to replacing valid values by incomplete wrappers, caused by the presence of private methods in the interface definition, as in #1191. Fixes #1191.
18 lines
186 B
Go
18 lines
186 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func main() {
|
|
t := testing.T{}
|
|
var tb testing.TB
|
|
tb = &t
|
|
if tb.TempDir() == "" {
|
|
println("FAIL")
|
|
return
|
|
}
|
|
println("PASS")
|
|
}
|
|
|
|
// Output:
|
|
// PASS
|