Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
2ee420fa
Commit
2ee420fa
authored
Sep 24, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
... changes
R=golang-dev, gri CC=golang-dev
https://golang.org/cl/2273042
parent
75dd8fdb
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
62 additions
and
62 deletions
+62
-62
util.go
src/cmd/cgo/util.go
+2
-2
goyacc.go
src/cmd/goyacc/goyacc.go
+1
-1
ascii85_test.go
src/pkg/encoding/ascii85/ascii85_test.go
+1
-1
base64_test.go
src/pkg/encoding/base64/base64_test.go
+1
-1
git_test.go
src/pkg/encoding/git85/git_test.go
+1
-1
datafmt.go
src/pkg/exp/datafmt/datafmt.go
+3
-3
datafmt_test.go
src/pkg/exp/datafmt/datafmt_test.go
+2
-2
compiler.go
src/pkg/exp/eval/compiler.go
+1
-1
expr.go
src/pkg/exp/eval/expr.go
+1
-1
stmt.go
src/pkg/exp/eval/stmt.go
+1
-1
print.go
src/pkg/fmt/print.go
+3
-3
scan.go
src/pkg/fmt/scan.go
+6
-6
print.go
src/pkg/go/ast/print.go
+1
-1
parser.go
src/pkg/go/parser/parser.go
+1
-1
printer.go
src/pkg/go/printer/printer.go
+1
-1
typechecker.go
src/pkg/go/typechecker/typechecker.go
+1
-1
log.go
src/pkg/log/log.go
+10
-10
textproto.go
src/pkg/net/textproto/textproto.go
+1
-1
writer.go
src/pkg/net/textproto/writer.go
+1
-1
export.go
src/pkg/netchan/export.go
+1
-1
import.go
src/pkg/netchan/import.go
+1
-1
nntp.go
src/pkg/nntp/nntp.go
+1
-1
path_test.go
src/pkg/path/path_test.go
+1
-1
template.go
src/pkg/template/template.go
+2
-2
testing.go
src/pkg/testing/testing.go
+6
-6
pidigits.go
test/bench/pidigits.go
+1
-1
ddd.go
test/ddd.go
+7
-7
defer.go
test/defer.go
+1
-1
bug252.go
test/fixedbugs/bug252.go
+2
-2
No files found.
src/cmd/cgo/util.go
View file @
2ee420fa
...
...
@@ -67,7 +67,7 @@ func run(stdin []byte, argv []string) (stdout, stderr []byte, ok bool) {
// Die with an error message.
func
fatal
(
msg
string
,
args
...
interface
{})
{
fmt
.
Fprintf
(
os
.
Stderr
,
msg
+
"
\n
"
,
args
)
fmt
.
Fprintf
(
os
.
Stderr
,
msg
+
"
\n
"
,
args
...
)
os
.
Exit
(
2
)
}
...
...
@@ -79,7 +79,7 @@ func error(pos token.Position, msg string, args ...interface{}) {
if
pos
.
IsValid
()
{
fmt
.
Fprintf
(
os
.
Stderr
,
"%s: "
,
pos
)
}
fmt
.
Fprintf
(
os
.
Stderr
,
msg
,
args
)
fmt
.
Fprintf
(
os
.
Stderr
,
msg
,
args
...
)
fmt
.
Fprintf
(
os
.
Stderr
,
"
\n
"
)
}
...
...
src/cmd/goyacc/goyacc.go
View file @
2ee420fa
...
...
@@ -3052,7 +3052,7 @@ func create(s string, m uint32) *bufio.Writer {
//
func
error
(
s
string
,
v
...
interface
{})
{
nerrors
++
fmt
.
Fprintf
(
stderr
,
s
,
v
)
fmt
.
Fprintf
(
stderr
,
s
,
v
...
)
fmt
.
Fprintf
(
stderr
,
": %v:%v
\n
"
,
infile
,
lineno
)
if
fatfl
!=
0
{
summary
()
...
...
src/pkg/encoding/ascii85/ascii85_test.go
View file @
2ee420fa
...
...
@@ -34,7 +34,7 @@ var bigtest = pairs[len(pairs)-1]
func
testEqual
(
t
*
testing
.
T
,
msg
string
,
args
...
interface
{})
bool
{
if
args
[
len
(
args
)
-
2
]
!=
args
[
len
(
args
)
-
1
]
{
t
.
Errorf
(
msg
,
args
)
t
.
Errorf
(
msg
,
args
...
)
return
false
}
return
true
...
...
src/pkg/encoding/base64/base64_test.go
View file @
2ee420fa
...
...
@@ -48,7 +48,7 @@ var bigtest = testpair{
func
testEqual
(
t
*
testing
.
T
,
msg
string
,
args
...
interface
{})
bool
{
if
args
[
len
(
args
)
-
2
]
!=
args
[
len
(
args
)
-
1
]
{
t
.
Errorf
(
msg
,
args
)
t
.
Errorf
(
msg
,
args
...
)
return
false
}
return
true
...
...
src/pkg/encoding/git85/git_test.go
View file @
2ee420fa
...
...
@@ -17,7 +17,7 @@ type testpair struct {
func
testEqual
(
t
*
testing
.
T
,
msg
string
,
args
...
interface
{})
bool
{
if
args
[
len
(
args
)
-
2
]
!=
args
[
len
(
args
)
-
1
]
{
t
.
Errorf
(
msg
,
args
)
t
.
Errorf
(
msg
,
args
...
)
return
false
}
return
true
...
...
src/pkg/exp/datafmt/datafmt.go
View file @
2ee420fa
...
...
@@ -697,7 +697,7 @@ func (f Format) Eval(env Environment, args ...interface{}) ([]byte, os.Error) {
// written and an os.Error, if any.
//
func
(
f
Format
)
Fprint
(
w
io
.
Writer
,
env
Environment
,
args
...
interface
{})
(
int
,
os
.
Error
)
{
data
,
err
:=
f
.
Eval
(
env
,
args
)
data
,
err
:=
f
.
Eval
(
env
,
args
...
)
if
err
!=
nil
{
// TODO should we print partial result in case of error?
return
0
,
err
...
...
@@ -711,7 +711,7 @@ func (f Format) Fprint(w io.Writer, env Environment, args ...interface{}) (int,
// number of bytes written and an os.Error, if any.
//
func
(
f
Format
)
Print
(
args
...
interface
{})
(
int
,
os
.
Error
)
{
return
f
.
Fprint
(
os
.
Stdout
,
nil
,
args
)
return
f
.
Fprint
(
os
.
Stdout
,
nil
,
args
...
)
}
...
...
@@ -722,7 +722,7 @@ func (f Format) Print(args ...interface{}) (int, os.Error) {
//
func
(
f
Format
)
Sprint
(
args
...
interface
{})
string
{
var
buf
bytes
.
Buffer
_
,
err
:=
f
.
Fprint
(
&
buf
,
nil
,
args
)
_
,
err
:=
f
.
Fprint
(
&
buf
,
nil
,
args
...
)
if
err
!=
nil
{
var
i
interface
{}
=
args
fmt
.
Fprintf
(
&
buf
,
"--- Sprint(%s) failed: %v"
,
fmt
.
Sprint
(
i
),
err
)
...
...
src/pkg/exp/datafmt/datafmt_test.go
View file @
2ee420fa
...
...
@@ -24,7 +24,7 @@ func verify(t *testing.T, f Format, expected string, args ...interface{}) {
if
f
==
nil
{
return
// allow other tests to run
}
result
:=
f
.
Sprint
(
args
)
result
:=
f
.
Sprint
(
args
...
)
if
result
!=
expected
{
t
.
Errorf
(
"result : `%s`
\n
expected: `%s`
\n\n
"
,
...
...
@@ -97,7 +97,7 @@ func check(t *testing.T, form, expected string, args ...interface{}) {
if
f
==
nil
{
return
// allow other tests to run
}
result
:=
f
.
Sprint
(
args
)
result
:=
f
.
Sprint
(
args
...
)
if
result
!=
expected
{
t
.
Errorf
(
"format : %s
\n
result : `%s`
\n
expected: `%s`
\n\n
"
,
...
...
src/pkg/exp/eval/compiler.go
View file @
2ee420fa
...
...
@@ -28,7 +28,7 @@ type compiler struct {
}
func
(
a
*
compiler
)
diagAt
(
pos
positioned
,
format
string
,
args
...
interface
{})
{
a
.
errors
.
Error
(
pos
.
Pos
(),
fmt
.
Sprintf
(
format
,
args
))
a
.
errors
.
Error
(
pos
.
Pos
(),
fmt
.
Sprintf
(
format
,
args
...
))
a
.
numErrors
++
}
...
...
src/pkg/exp/eval/expr.go
View file @
2ee420fa
...
...
@@ -65,7 +65,7 @@ func (a *exprInfo) newExpr(t Type, desc string) *expr {
}
func
(
a
*
exprInfo
)
diag
(
format
string
,
args
...
interface
{})
{
a
.
diagAt
(
&
a
.
pos
,
format
,
args
)
a
.
diagAt
(
&
a
.
pos
,
format
,
args
...
)
}
func
(
a
*
exprInfo
)
diagOpType
(
op
token
.
Token
,
vt
Type
)
{
...
...
src/pkg/exp/eval/stmt.go
View file @
2ee420fa
...
...
@@ -28,7 +28,7 @@ type stmtCompiler struct {
}
func
(
a
*
stmtCompiler
)
diag
(
format
string
,
args
...
interface
{})
{
a
.
diagAt
(
&
a
.
pos
,
format
,
args
)
a
.
diagAt
(
&
a
.
pos
,
format
,
args
...
)
}
/*
...
...
src/pkg/fmt/print.go
View file @
2ee420fa
...
...
@@ -146,7 +146,7 @@ func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error os.Erro
// Printf formats according to a format specifier and writes to standard output.
// It returns the number of bytes written and any write error encountered.
func
Printf
(
format
string
,
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
n
,
errno
=
Fprintf
(
os
.
Stdout
,
format
,
a
)
n
,
errno
=
Fprintf
(
os
.
Stdout
,
format
,
a
...
)
return
n
,
errno
}
...
...
@@ -176,7 +176,7 @@ func Fprint(w io.Writer, a ...interface{}) (n int, error os.Error) {
// Spaces are added between operands when neither is a string.
// It returns the number of bytes written and any write error encountered.
func
Print
(
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
n
,
errno
=
Fprint
(
os
.
Stdout
,
a
)
n
,
errno
=
Fprint
(
os
.
Stdout
,
a
...
)
return
n
,
errno
}
...
...
@@ -209,7 +209,7 @@ func Fprintln(w io.Writer, a ...interface{}) (n int, error os.Error) {
// Spaces are always added between operands and a newline is appended.
// It returns the number of bytes written and any write error encountered.
func
Println
(
a
...
interface
{})
(
n
int
,
errno
os
.
Error
)
{
n
,
errno
=
Fprintln
(
os
.
Stdout
,
a
)
n
,
errno
=
Fprintln
(
os
.
Stdout
,
a
...
)
return
n
,
errno
}
...
...
src/pkg/fmt/scan.go
View file @
2ee420fa
...
...
@@ -60,20 +60,20 @@ type Scanner interface {
// as space. It returns the number of items successfully scanned.
// If that is less than the number of arguments, err will report why.
func
Scan
(
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
return
Fscan
(
os
.
Stdin
,
a
)
return
Fscan
(
os
.
Stdin
,
a
...
)
}
// Scanln is similar to Scan, but stops scanning at a newline and
// after the final item there must be a newline or EOF.
func
Scanln
(
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
return
Fscanln
(
os
.
Stdin
,
a
)
return
Fscanln
(
os
.
Stdin
,
a
...
)
}
// Scanf scans text read from standard input, storing successive
// space-separated values into successive arguments as determined by
// the format. It returns the number of items successfully scanned.
func
Scanf
(
format
string
,
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
return
Fscanf
(
os
.
Stdin
,
format
,
a
)
return
Fscanf
(
os
.
Stdin
,
format
,
a
...
)
}
// Sscan scans the argument string, storing successive space-separated
...
...
@@ -81,20 +81,20 @@ func Scanf(format string, a ...interface{}) (n int, err os.Error) {
// returns the number of items successfully scanned. If that is less
// than the number of arguments, err will report why.
func
Sscan
(
str
string
,
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
return
Fscan
(
strings
.
NewReader
(
str
),
a
)
return
Fscan
(
strings
.
NewReader
(
str
),
a
...
)
}
// Sscanln is similar to Sscan, but stops scanning at a newline and
// after the final item there must be a newline or EOF.
func
Sscanln
(
str
string
,
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
return
Fscanln
(
strings
.
NewReader
(
str
),
a
)
return
Fscanln
(
strings
.
NewReader
(
str
),
a
...
)
}
// Sscanf scans the argument string, storing successive space-separated
// values into successive arguments as determined by the format. It
// returns the number of items successfully parsed.
func
Sscanf
(
str
string
,
format
string
,
a
...
interface
{})
(
n
int
,
err
os
.
Error
)
{
return
Fscanf
(
strings
.
NewReader
(
str
),
format
,
a
)
return
Fscanf
(
strings
.
NewReader
(
str
),
format
,
a
...
)
}
// Fscan scans text read from r, storing successive space-separated
...
...
src/pkg/go/ast/print.go
View file @
2ee420fa
...
...
@@ -124,7 +124,7 @@ type localError struct {
// printf is a convenience wrapper that takes care of print errors.
func
(
p
*
printer
)
printf
(
format
string
,
args
...
interface
{})
{
n
,
err
:=
fmt
.
Fprintf
(
p
,
format
,
args
)
n
,
err
:=
fmt
.
Fprintf
(
p
,
format
,
args
...
)
p
.
written
+=
n
if
err
!=
nil
{
panic
(
localError
{
err
})
...
...
src/pkg/go/parser/parser.go
View file @
2ee420fa
...
...
@@ -90,7 +90,7 @@ func (p *parser) printTrace(a ...interface{}) {
fmt
.
Print
(
dots
)
}
fmt
.
Print
(
dots
[
0
:
i
])
fmt
.
Println
(
a
)
fmt
.
Println
(
a
...
)
}
...
...
src/pkg/go/printer/printer.go
View file @
2ee420fa
...
...
@@ -105,7 +105,7 @@ func (p *printer) init(output io.Writer, cfg *Config) {
func
(
p
*
printer
)
internalError
(
msg
...
interface
{})
{
if
debug
{
fmt
.
Print
(
p
.
pos
.
String
()
+
": "
)
fmt
.
Println
(
msg
)
fmt
.
Println
(
msg
...
)
panic
(
"go/printer"
)
}
}
...
...
src/pkg/go/typechecker/typechecker.go
View file @
2ee420fa
...
...
@@ -70,7 +70,7 @@ type typechecker struct {
func
(
tc
*
typechecker
)
Errorf
(
pos
token
.
Position
,
format
string
,
args
...
interface
{})
{
tc
.
Error
(
pos
,
fmt
.
Sprintf
(
format
,
args
))
tc
.
Error
(
pos
,
fmt
.
Sprintf
(
format
,
args
...
))
}
...
...
src/pkg/log/log.go
View file @
2ee420fa
...
...
@@ -150,32 +150,32 @@ func (l *Logger) Output(calldepth int, s string) os.Error {
// Logf is analogous to Printf() for a Logger.
func
(
l
*
Logger
)
Logf
(
format
string
,
v
...
interface
{})
{
l
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
))
l
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
...
))
}
// Log is analogous to Print() for a Logger.
func
(
l
*
Logger
)
Log
(
v
...
interface
{})
{
l
.
Output
(
2
,
fmt
.
Sprintln
(
v
))
}
func
(
l
*
Logger
)
Log
(
v
...
interface
{})
{
l
.
Output
(
2
,
fmt
.
Sprintln
(
v
...
))
}
// Stdout is a helper function for easy logging to stdout. It is analogous to Print().
func
Stdout
(
v
...
interface
{})
{
stdout
.
Output
(
2
,
fmt
.
Sprint
(
v
))
}
func
Stdout
(
v
...
interface
{})
{
stdout
.
Output
(
2
,
fmt
.
Sprint
(
v
...
))
}
// Stderr is a helper function for easy logging to stderr. It is analogous to Fprint(os.Stderr).
func
Stderr
(
v
...
interface
{})
{
stderr
.
Output
(
2
,
fmt
.
Sprintln
(
v
))
}
func
Stderr
(
v
...
interface
{})
{
stderr
.
Output
(
2
,
fmt
.
Sprintln
(
v
...
))
}
// Stdoutf is a helper functions for easy formatted logging to stdout. It is analogous to Printf().
func
Stdoutf
(
format
string
,
v
...
interface
{})
{
stdout
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
))
}
func
Stdoutf
(
format
string
,
v
...
interface
{})
{
stdout
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
...
))
}
// Stderrf is a helper function for easy formatted logging to stderr. It is analogous to Fprintf(os.Stderr).
func
Stderrf
(
format
string
,
v
...
interface
{})
{
stderr
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
))
}
func
Stderrf
(
format
string
,
v
...
interface
{})
{
stderr
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
...
))
}
// Exit is equivalent to Stderr() followed by a call to os.Exit(1).
func
Exit
(
v
...
interface
{})
{
exit
.
Output
(
2
,
fmt
.
Sprintln
(
v
))
}
func
Exit
(
v
...
interface
{})
{
exit
.
Output
(
2
,
fmt
.
Sprintln
(
v
...
))
}
// Exitf is equivalent to Stderrf() followed by a call to os.Exit(1).
func
Exitf
(
format
string
,
v
...
interface
{})
{
exit
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
))
}
func
Exitf
(
format
string
,
v
...
interface
{})
{
exit
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
...
))
}
// Crash is equivalent to Stderr() followed by a call to panic().
func
Crash
(
v
...
interface
{})
{
crash
.
Output
(
2
,
fmt
.
Sprintln
(
v
))
}
func
Crash
(
v
...
interface
{})
{
crash
.
Output
(
2
,
fmt
.
Sprintln
(
v
...
))
}
// Crashf is equivalent to Stderrf() followed by a call to panic().
func
Crashf
(
format
string
,
v
...
interface
{})
{
crash
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
))
}
func
Crashf
(
format
string
,
v
...
interface
{})
{
crash
.
Output
(
2
,
fmt
.
Sprintf
(
format
,
v
...
))
}
src/pkg/net/textproto/textproto.go
View file @
2ee420fa
...
...
@@ -113,7 +113,7 @@ func Dial(network, addr string) (*Conn, os.Error) {
func
(
c
*
Conn
)
Cmd
(
format
string
,
args
...
interface
{})
(
id
uint
,
err
os
.
Error
)
{
id
=
c
.
Next
()
c
.
StartRequest
(
id
)
err
=
c
.
PrintfLine
(
format
,
args
)
err
=
c
.
PrintfLine
(
format
,
args
...
)
c
.
EndRequest
(
id
)
if
err
!=
nil
{
return
0
,
err
...
...
src/pkg/net/textproto/writer.go
View file @
2ee420fa
...
...
@@ -29,7 +29,7 @@ var dotcrnl = []byte{'.', '\r', '\n'}
// PrintfLine writes the formatted output followed by \r\n.
func
(
w
*
Writer
)
PrintfLine
(
format
string
,
args
...
interface
{})
os
.
Error
{
w
.
closeDot
()
fmt
.
Fprintf
(
w
.
W
,
format
,
args
)
fmt
.
Fprintf
(
w
.
W
,
format
,
args
...
)
w
.
W
.
Write
(
crnl
)
return
w
.
W
.
Flush
()
}
...
...
src/pkg/netchan/export.go
View file @
2ee420fa
...
...
@@ -34,7 +34,7 @@ import (
// expLog is a logging convenience function. The first argument must be a string.
func
expLog
(
args
...
interface
{})
{
args
[
0
]
=
"netchan export: "
+
args
[
0
]
.
(
string
)
log
.
Stderr
(
args
)
log
.
Stderr
(
args
...
)
}
// An Exporter allows a set of channels to be published on a single
...
...
src/pkg/netchan/import.go
View file @
2ee420fa
...
...
@@ -17,7 +17,7 @@ import (
// impLog is a logging convenience function. The first argument must be a string.
func
impLog
(
args
...
interface
{})
{
args
[
0
]
=
"netchan import: "
+
args
[
0
]
.
(
string
)
log
.
Stderr
(
args
)
log
.
Stderr
(
args
...
)
}
// An Importer allows a set of channels to be imported from a single
...
...
src/pkg/nntp/nntp.go
View file @
2ee420fa
...
...
@@ -270,7 +270,7 @@ func (c *Conn) cmd(expectCode uint, format string, args ...interface{}) (code ui
}
c
.
br
=
nil
}
if
_
,
err
:=
fmt
.
Fprintf
(
c
.
conn
,
format
+
"
\r\n
"
,
args
);
err
!=
nil
{
if
_
,
err
:=
fmt
.
Fprintf
(
c
.
conn
,
format
+
"
\r\n
"
,
args
...
);
err
!=
nil
{
return
0
,
""
,
err
}
line
,
err
=
c
.
r
.
ReadString
(
'\n'
)
...
...
src/pkg/path/path_test.go
View file @
2ee420fa
...
...
@@ -118,7 +118,7 @@ var jointests = []JoinTest{
// join takes a []string and passes it to Join.
func
join
(
elem
[]
string
,
args
...
string
)
string
{
args
=
elem
return
Join
(
args
)
return
Join
(
args
...
)
}
func
TestJoin
(
t
*
testing
.
T
)
{
...
...
src/pkg/template/template.go
View file @
2ee420fa
...
...
@@ -185,13 +185,13 @@ func New(fmap FormatterMap) *Template {
// Report error and stop executing. The line number must be provided explicitly.
func
(
t
*
Template
)
execError
(
st
*
state
,
line
int
,
err
string
,
args
...
interface
{})
{
panic
(
&
Error
{
line
,
fmt
.
Sprintf
(
err
,
args
)})
panic
(
&
Error
{
line
,
fmt
.
Sprintf
(
err
,
args
...
)})
}
// Report error, panic to terminate parsing.
// The line number comes from the template state.
func
(
t
*
Template
)
parseError
(
err
string
,
args
...
interface
{})
{
panic
(
&
Error
{
t
.
linenum
,
fmt
.
Sprintf
(
err
,
args
)})
panic
(
&
Error
{
t
.
linenum
,
fmt
.
Sprintf
(
err
,
args
...
)})
}
// -- Lexical analysis
...
...
src/pkg/testing/testing.go
View file @
2ee420fa
...
...
@@ -89,35 +89,35 @@ 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
...
interface
{})
{
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
...
interface
{})
{
t
.
errors
+=
"
\t
"
+
tabify
(
fmt
.
Sprintf
(
format
,
args
))
t
.
errors
+=
"
\t
"
+
tabify
(
fmt
.
Sprintf
(
format
,
args
...
))
}
// Error is equivalent to Log() followed by Fail().
func
(
t
*
T
)
Error
(
args
...
interface
{})
{
t
.
Log
(
args
)
t
.
Log
(
args
...
)
t
.
Fail
()
}
// Errorf is equivalent to Logf() followed by Fail().
func
(
t
*
T
)
Errorf
(
format
string
,
args
...
interface
{})
{
t
.
Logf
(
format
,
args
)
t
.
Logf
(
format
,
args
...
)
t
.
Fail
()
}
// Fatal is equivalent to Log() followed by FailNow().
func
(
t
*
T
)
Fatal
(
args
...
interface
{})
{
t
.
Log
(
args
)
t
.
Log
(
args
...
)
t
.
FailNow
()
}
// Fatalf is equivalent to Logf() followed by FailNow().
func
(
t
*
T
)
Fatalf
(
format
string
,
args
...
interface
{})
{
t
.
Logf
(
format
,
args
)
t
.
Logf
(
format
,
args
...
)
t
.
FailNow
()
}
...
...
test/bench/pidigits.go
View file @
2ee420fa
...
...
@@ -100,7 +100,7 @@ func eliminate_digit(d int64) {
func
printf
(
s
string
,
arg
...
interface
{})
{
if
!*
silent
{
fmt
.
Printf
(
s
,
arg
)
fmt
.
Printf
(
s
,
arg
...
)
}
}
...
...
test/ddd.go
View file @
2ee420fa
...
...
@@ -14,13 +14,13 @@ func sum(args ...int) int {
return
s
}
func
sumC
(
args
...
int
)
int
{
return
func
()
int
{
return
sum
(
args
)
}()
}
func
sumC
(
args
...
int
)
int
{
return
func
()
int
{
return
sum
(
args
...
)
}()
}
var
sumD
=
func
(
args
...
int
)
int
{
return
sum
(
args
)
}
var
sumD
=
func
(
args
...
int
)
int
{
return
sum
(
args
...
)
}
var
sumE
=
func
()
func
(
...
int
)
int
{
return
func
(
args
...
int
)
int
{
return
sum
(
args
)
}
}()
var
sumE
=
func
()
func
(
...
int
)
int
{
return
func
(
args
...
int
)
int
{
return
sum
(
args
...
)
}
}()
var
sumF
=
func
(
args
...
int
)
func
()
int
{
return
func
()
int
{
return
sum
(
args
)
}
}
var
sumF
=
func
(
args
...
int
)
func
()
int
{
return
func
()
int
{
return
sum
(
args
...
)
}
}
func
sumA
(
args
[]
int
)
int
{
s
:=
0
...
...
@@ -30,7 +30,7 @@ func sumA(args []int) int {
return
s
}
func
sum2
(
args
...
int
)
int
{
return
2
*
sum
(
args
)
}
func
sum2
(
args
...
int
)
int
{
return
2
*
sum
(
args
...
)
}
func
sum3
(
args
...
int
)
int
{
return
3
*
sumA
(
args
)
}
...
...
@@ -46,9 +46,9 @@ type T []T
func
ln
(
args
...
T
)
int
{
return
len
(
args
)
}
func
ln2
(
args
...
T
)
int
{
return
2
*
ln
(
args
)
}
func
ln2
(
args
...
T
)
int
{
return
2
*
ln
(
args
...
)
}
func
(
*
T
)
Sum
(
args
...
int
)
int
{
return
sum
(
args
)
}
func
(
*
T
)
Sum
(
args
...
int
)
int
{
return
sum
(
args
...
)
}
type
U
struct
{
*
T
...
...
test/defer.go
View file @
2ee420fa
...
...
@@ -26,7 +26,7 @@ func test1() {
}
}
func
addDotDotDot
(
v
...
interface
{})
{
result
+=
fmt
.
Sprint
(
v
)
}
func
addDotDotDot
(
v
...
interface
{})
{
result
+=
fmt
.
Sprint
(
v
...
)
}
func
test2helper
()
{
for
i
:=
0
;
i
<
10
;
i
++
{
...
...
test/fixedbugs/bug252.go
View file @
2ee420fa
...
...
@@ -7,9 +7,9 @@
package
main
func
f
(
args
...
int
)
{
g
(
args
)
// ERROR "[.][.][.]
mismatch
"
g
(
args
)
// ERROR "[.][.][.]"
}
func
g
(
args
...
interface
{})
{
f
(
args
)
// ERROR "[.][.][.]
mismatch
"
f
(
args
)
// ERROR "[.][.][.]"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment