Last active
August 29, 2015 14:07
-
-
Save chai2010/cffe524439a9a3c3011d to your computer and use it in GitHub Desktop.
Go模拟显示接口
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "testing" | |
| ) | |
| func main() { | |
| testTB(new(TB)) | |
| } | |
| func testTB(t testing.TB) { | |
| t.Fatal("foo") | |
| } | |
| type TB struct { | |
| testing.TB | |
| } | |
| func (p *TB) Fatal(args ...interface{}) { | |
| fmt.Println("TB.Fatal disabled!") | |
| } | |
| // http://play.golang.org/p/L5CEf7982p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment