mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Change type of Printf's args to ... interface{}
R=rsc CC=golang-dev https://golang.org/cl/197043
This commit is contained in:
parent
1f11ece67f
commit
d2fc5d68da
15 changed files with 248 additions and 141 deletions
|
|
@ -89,34 +89,34 @@ func (t *T) FailNow() {
|
|||
|
||||
// Log formats its arguments using default formatting, analogous to Print(),
|
||||
// and records the text in the error log.
|
||||
func (t *T) Log(args ...) { t.errors += "\t" + tabify(fmt.Sprintln(args)) }
|
||||
func (t *T) Log(args ...interface{}) { t.errors += "\t" + tabify(fmt.Sprintln(args)) }
|
||||
|
||||
// Log formats its arguments according to the format, analogous to Printf(),
|
||||
// and records the text in the error log.
|
||||
func (t *T) Logf(format string, args ...) {
|
||||
func (t *T) Logf(format string, args ...interface{}) {
|
||||
t.errors += "\t" + tabify(fmt.Sprintf(format, args))
|
||||
}
|
||||
|
||||
// Error is equivalent to Log() followed by Fail().
|
||||
func (t *T) Error(args ...) {
|
||||
func (t *T) Error(args ...interface{}) {
|
||||
t.Log(args)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
// Errorf is equivalent to Logf() followed by Fail().
|
||||
func (t *T) Errorf(format string, args ...) {
|
||||
func (t *T) Errorf(format string, args ...interface{}) {
|
||||
t.Logf(format, args)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
// Fatal is equivalent to Log() followed by FailNow().
|
||||
func (t *T) Fatal(args ...) {
|
||||
func (t *T) Fatal(args ...interface{}) {
|
||||
t.Log(args)
|
||||
t.FailNow()
|
||||
}
|
||||
|
||||
// Fatalf is equivalent to Logf() followed by FailNow().
|
||||
func (t *T) Fatalf(format string, args ...) {
|
||||
func (t *T) Fatalf(format string, args ...interface{}) {
|
||||
t.Logf(format, args)
|
||||
t.FailNow()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue