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
03babfc6
Commit
03babfc6
authored
Oct 01, 2010
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Errorf where appropriate.
R=r, r2 CC=golang-dev
https://golang.org/cl/2308043
parent
558477ee
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
17 deletions
+14
-17
hg.go
misc/dashboard/builder/hg.go
+2
-1
main.go
misc/dashboard/builder/main.go
+8
-12
printer.go
src/pkg/go/printer/printer.go
+1
-1
writer_test.go
src/pkg/image/png/writer_test.go
+2
-2
client.go
src/pkg/rpc/jsonrpc/client.go
+1
-1
No files found.
misc/dashboard/builder/hg.go
View file @
03babfc6
package
main
import
(
"fmt"
"os"
"strconv"
"strings"
...
...
@@ -19,7 +20,7 @@ type Commit struct {
func
getCommit
(
rev
string
)
(
c
Commit
,
err
os
.
Error
)
{
defer
func
()
{
if
err
!=
nil
{
err
=
er
rf
(
"getCommit: %s: %s"
,
rev
,
err
)
err
=
fmt
.
Erro
rf
(
"getCommit: %s: %s"
,
rev
,
err
)
}
}()
parts
,
err
:=
getCommitParts
(
rev
)
...
...
misc/dashboard/builder/main.go
View file @
03babfc6
...
...
@@ -156,7 +156,7 @@ func NewBuilder(builder string) (*Builder, os.Error) {
if
len
(
s
)
==
2
{
b
.
goos
,
b
.
goarch
=
s
[
0
],
s
[
1
]
}
else
{
return
nil
,
er
rf
(
"unsupported builder form: %s"
,
builder
)
return
nil
,
fmt
.
Erro
rf
(
"unsupported builder form: %s"
,
builder
)
}
// read keys from keyfile
...
...
@@ -166,7 +166,7 @@ func NewBuilder(builder string) (*Builder, os.Error) {
}
c
,
err
:=
ioutil
.
ReadFile
(
fn
)
if
err
!=
nil
{
return
nil
,
er
rf
(
"readKeys %s (%s): %s"
,
b
.
name
,
fn
,
err
)
return
nil
,
fmt
.
Erro
rf
(
"readKeys %s (%s): %s"
,
b
.
name
,
fn
,
err
)
}
v
:=
strings
.
Split
(
string
(
c
),
"
\n
"
,
-
1
)
b
.
key
=
v
[
0
]
...
...
@@ -207,7 +207,7 @@ func (b *Builder) build() bool {
func
(
b
*
Builder
)
nextCommit
()
(
nextC
*
Commit
,
err
os
.
Error
)
{
defer
func
()
{
if
err
!=
nil
{
err
=
er
rf
(
"%s nextCommit: %s"
,
b
.
name
,
err
)
err
=
fmt
.
Erro
rf
(
"%s nextCommit: %s"
,
b
.
name
,
err
)
}
}()
hw
,
err
:=
b
.
getHighWater
()
...
...
@@ -229,7 +229,7 @@ func (b *Builder) nextCommit() (nextC *Commit, err os.Error) {
func
(
b
*
Builder
)
buildCommit
(
c
Commit
)
(
err
os
.
Error
)
{
defer
func
()
{
if
err
!=
nil
{
err
=
er
rf
(
"%s buildCommit: %d: %s"
,
b
.
name
,
c
.
num
,
err
)
err
=
fmt
.
Erro
rf
(
"%s buildCommit: %d: %s"
,
b
.
name
,
c
.
num
,
err
)
}
}()
...
...
@@ -271,7 +271,7 @@ func (b *Builder) buildCommit(c Commit) (err os.Error) {
// build
buildLog
,
status
,
err
:=
runLog
(
env
,
srcDir
,
*
buildCmd
)
if
err
!=
nil
{
return
er
rf
(
"all.bash: %s"
,
err
)
return
fmt
.
Erro
rf
(
"all.bash: %s"
,
err
)
}
if
status
!=
0
{
// record failure
...
...
@@ -280,7 +280,7 @@ func (b *Builder) buildCommit(c Commit) (err os.Error) {
// record success
if
err
=
b
.
recordResult
(
""
,
c
);
err
!=
nil
{
return
er
rf
(
"recordResult: %s"
,
err
)
return
fmt
.
Erro
rf
(
"recordResult: %s"
,
err
)
}
// send benchmark request if benchmarks are enabled
...
...
@@ -303,13 +303,13 @@ func (b *Builder) buildCommit(c Commit) (err os.Error) {
// clean out build state
err
=
run
(
env
,
srcDir
,
"./clean.bash"
,
"--nopkg"
)
if
err
!=
nil
{
return
er
rf
(
"clean.bash: %s"
,
err
)
return
fmt
.
Erro
rf
(
"clean.bash: %s"
,
err
)
}
// upload binary release
fn
:=
fmt
.
Sprintf
(
"%s.%s-%s.tar.gz"
,
release
,
b
.
goos
,
b
.
goarch
)
err
=
run
(
nil
,
workpath
,
"tar"
,
"czf"
,
fn
,
"go"
)
if
err
!=
nil
{
return
er
rf
(
"tar: %s"
,
err
)
return
fmt
.
Erro
rf
(
"tar: %s"
,
err
)
}
err
=
run
(
nil
,
workpath
,
"python"
,
path
.
Join
(
goroot
,
codePyScript
),
...
...
@@ -333,7 +333,3 @@ func isFile(name string) bool {
s
,
err
:=
os
.
Stat
(
name
)
return
err
==
nil
&&
(
s
.
IsRegular
()
||
s
.
IsSymlink
())
}
func
errf
(
format
string
,
args
...
interface
{})
os
.
Error
{
return
os
.
NewError
(
fmt
.
Sprintf
(
format
,
args
))
}
src/pkg/go/printer/printer.go
View file @
03babfc6
...
...
@@ -1091,7 +1091,7 @@ func (cfg *Config) Fprint(output io.Writer, node interface{}) (int, os.Error) {
p
.
useNodeComments
=
n
.
Comments
==
nil
p
.
file
(
n
)
default
:
p
.
errors
<-
os
.
NewError
(
fmt
.
Sprintf
(
"printer.Fprint: unsupported node type %T"
,
n
)
)
p
.
errors
<-
fmt
.
Errorf
(
"printer.Fprint: unsupported node type %T"
,
n
)
runtime
.
Goexit
()
}
p
.
flush
(
token
.
Position
{
Offset
:
infinity
,
Line
:
infinity
},
token
.
EOF
)
...
...
src/pkg/image/png/writer_test.go
View file @
03babfc6
...
...
@@ -15,14 +15,14 @@ import (
func
diff
(
m0
,
m1
image
.
Image
)
os
.
Error
{
b0
,
b1
:=
m0
.
Bounds
(),
m1
.
Bounds
()
if
!
b0
.
Eq
(
b1
)
{
return
os
.
NewError
(
fmt
.
Sprintf
(
"dimensions differ: %v vs %v"
,
b0
,
b1
)
)
return
fmt
.
Errorf
(
"dimensions differ: %v vs %v"
,
b0
,
b1
)
}
for
y
:=
b0
.
Min
.
Y
;
y
<
b0
.
Max
.
Y
;
y
++
{
for
x
:=
b0
.
Min
.
X
;
x
<
b0
.
Max
.
X
;
x
++
{
r0
,
g0
,
b0
,
a0
:=
m0
.
At
(
x
,
y
)
.
RGBA
()
r1
,
g1
,
b1
,
a1
:=
m1
.
At
(
x
,
y
)
.
RGBA
()
if
r0
!=
r1
||
g0
!=
g1
||
b0
!=
b1
||
a0
!=
a1
{
return
os
.
NewError
(
fmt
.
Sprintf
(
"colors differ at (%d, %d): %v vs %v"
,
x
,
y
,
m0
.
At
(
x
,
y
),
m1
.
At
(
x
,
y
)
))
return
fmt
.
Errorf
(
"colors differ at (%d, %d): %v vs %v"
,
x
,
y
,
m0
.
At
(
x
,
y
),
m1
.
At
(
x
,
y
))
}
}
}
...
...
src/pkg/rpc/jsonrpc/client.go
View file @
03babfc6
...
...
@@ -87,7 +87,7 @@ func (c *clientCodec) ReadResponseHeader(r *rpc.Response) os.Error {
if
c
.
resp
.
Error
!=
nil
{
x
,
ok
:=
c
.
resp
.
Error
.
(
string
)
if
!
ok
{
return
os
.
NewError
(
fmt
.
Sprintf
(
"invalid error %v"
,
c
.
resp
.
Error
)
)
return
fmt
.
Errorf
(
"invalid error %v"
,
c
.
resp
.
Error
)
}
if
x
==
""
{
x
=
"unspecified 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