Fixing other potential problems related to redeclaring err within a inner block. Also changing harmless look-alike cases for style consistency

This commit is contained in:
Yves Junqueira 2010-07-25 15:30:32 +01:00
parent af804a47fa
commit 56e375d053

View file

@ -61,7 +61,8 @@ type Builder interface {
func collectInt(r Reader, delim byte) (buf []byte, err os.Error) { func collectInt(r Reader, delim byte) (buf []byte, err os.Error) {
for { for {
c, err := r.ReadByte() var c byte
c, err = r.ReadByte()
if err != nil { if err != nil {
return return
} }
@ -87,11 +88,11 @@ func decodeInt64(r Reader, delim byte) (data int64, err os.Error) {
} }
func decodeString(r Reader) (data string, err os.Error) { func decodeString(r Reader) (data string, err os.Error) {
len, err := decodeInt64(r, ':') length, err := decodeInt64(r, ':')
if err != nil { if err != nil {
return return
} }
if len < 0 { if length < 0 {
err = os.NewError("Bad string length") err = os.NewError("Bad string length")
return return
} }