From 68da07875073d04f808f688c70e7bec282f16a5d Mon Sep 17 00:00:00 2001 From: Chidambaram Annamalai Date: Sat, 12 Feb 2011 13:47:47 +0530 Subject: [PATCH] Fixes for latest version of Go (2011 Feb) - bytes.AddBytes replaced by append() - reflect.ArrayCopy renamed to reflect.Copy --- parse.go | 3 +-- struct.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/parse.go b/parse.go index 3a409a6..0cb2541 100644 --- a/parse.go +++ b/parse.go @@ -9,7 +9,6 @@ package bencode import ( "bufio" - "bytes" "fmt" "io" "os" @@ -73,7 +72,7 @@ func collectInt(r Reader, delim byte) (buf []byte, err os.Error) { err = os.NewError("expected digit") return } - buf = bytes.AddByte(buf, c) + buf = append(buf, c) } return } diff --git a/struct.go b/struct.go index 7654d61..cd9b583 100644 --- a/struct.go +++ b/struct.go @@ -144,7 +144,7 @@ func (b *structBuilder) Elem(i int) Builder { n *= 2 } nv := reflect.MakeSlice(v.Type().(*reflect.SliceType), v.Len(), n) - reflect.ArrayCopy(nv, v) + reflect.Copy(nv, v) v.Set(nv) } if v.Len() <= i && i < v.Cap() {