diff options
author | Russ Cox <rsc@golang.org> | 2010-06-20 11:45:53 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2010-06-20 11:45:53 -0700 |
commit | 3d434f2574c951249e9b317d3313617963673269 (patch) | |
tree | 9a814e6cb257c3224f01cfa0d9e827b687a5bc45 /src/pkg/image/png | |
parent | 58da368d8786780b73dc3d094c5f81c34df07a10 (diff) | |
download | golang-3d434f2574c951249e9b317d3313617963673269.tar.gz |
gc: better error messages for interface failures, conversions
x.go:13: cannot use t (type T) as type Reader in assignment:
T does not implement Reader (Read method requires pointer receiver)
x.go:19: cannot use q (type Q) as type Reader in assignment:
Q does not implement Reader (missing Read method)
have read()
want Read()
x.go:22: cannot use z (type int) as type Reader in assignment:
int does not implement Reader (missing Read method)
x.go:24: too many arguments to conversion to complex: complex(1, 3)
R=ken2
CC=golang-dev
http://codereview.appspot.com/1736041
Diffstat (limited to 'src/pkg/image/png')
-rw-r--r-- | src/pkg/image/png/reader.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkg/image/png/reader.go b/src/pkg/image/png/reader.go index fddb70423..33f00eb77 100644 --- a/src/pkg/image/png/reader.go +++ b/src/pkg/image/png/reader.go @@ -14,6 +14,7 @@ import ( "image" "io" "os" + "strconv" ) // Color type, as per the PNG spec. @@ -108,7 +109,7 @@ func (d *decoder) parseIHDR(r io.Reader, crc hash.Hash32, length uint32) os.Erro } crc.Write(d.tmp[0:13]) if d.tmp[8] != 8 { - return UnsupportedError("bit depth") + return UnsupportedError("bit depth " + strconv.Itoa(int(d.tmp[8]))) } if d.tmp[10] != 0 || d.tmp[11] != 0 || d.tmp[12] != 0 { return UnsupportedError("compression, filter or interlace method") |