diff options
Diffstat (limited to 'libgo/go/encoding/base32/base32.go')
-rw-r--r-- | libgo/go/encoding/base32/base32.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libgo/go/encoding/base32/base32.go b/libgo/go/encoding/base32/base32.go index acace30d6ac..494c760d87d 100644 --- a/libgo/go/encoding/base32/base32.go +++ b/libgo/go/encoding/base32/base32.go @@ -7,7 +7,6 @@ package base32 import ( "io" - "os" "strconv" ) @@ -127,7 +126,7 @@ func (enc *Encoding) Encode(dst, src []byte) { } type encoder struct { - err os.Error + err error enc *Encoding w io.Writer buf [5]byte // buffered data waiting to be encoded @@ -135,7 +134,7 @@ type encoder struct { out [1024]byte // output buffer } -func (e *encoder) Write(p []byte) (n int, err os.Error) { +func (e *encoder) Write(p []byte) (n int, err error) { if e.err != nil { return 0, e.err } @@ -187,7 +186,7 @@ func (e *encoder) Write(p []byte) (n int, err os.Error) { // Close flushes any pending output from the encoder. // It is an error to call Write after calling Close. -func (e *encoder) Close() os.Error { +func (e *encoder) Close() error { // If there's anything left in the buffer, flush it out if e.err == nil && e.nbuf > 0 { e.enc.Encode(e.out[0:], e.buf[0:e.nbuf]) @@ -216,7 +215,7 @@ func (enc *Encoding) EncodedLen(n int) int { return (n + 4) / 5 * 8 } type CorruptInputError int64 -func (e CorruptInputError) String() string { +func (e CorruptInputError) Error() string { return "illegal base32 data at input byte " + strconv.Itoa64(int64(e)) } @@ -224,7 +223,7 @@ func (e CorruptInputError) String() string { // indicates if end-of-message padding was encountered and thus any // additional data is an error. decode also assumes len(src)%8==0, // since it is meant for internal use. -func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err os.Error) { +func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) { for i := 0; i < len(src)/8 && !end; i++ { // Decode quantum using the base32 alphabet var dbuf [8]byte @@ -290,7 +289,7 @@ func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err os.Error) { // DecodedLen(len(src)) bytes to dst and returns the number of bytes // written. If src contains invalid base32 data, it will return the // number of bytes successfully written and CorruptInputError. -func (enc *Encoding) Decode(dst, src []byte) (n int, err os.Error) { +func (enc *Encoding) Decode(dst, src []byte) (n int, err error) { if len(src)%8 != 0 { return 0, CorruptInputError(len(src) / 8 * 8) } @@ -300,7 +299,7 @@ func (enc *Encoding) Decode(dst, src []byte) (n int, err os.Error) { } type decoder struct { - err os.Error + err error enc *Encoding r io.Reader end bool // saw end of message @@ -310,7 +309,7 @@ type decoder struct { outbuf [1024 / 8 * 5]byte } -func (d *decoder) Read(p []byte) (n int, err os.Error) { +func (d *decoder) Read(p []byte) (n int, err error) { if d.err != nil { return 0, d.err } |