]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/binary: better example
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 27 Feb 2012 23:15:23 +0000 (10:15 +1100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 27 Feb 2012 23:15:23 +0000 (10:15 +1100)
leave that joke to Java.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5695080

src/pkg/encoding/binary/example_test.go

index 405ea67891a8e3e1ec326ebf07edbde25e890efb..dec12ebf5d19d59aa6f102a4e1d84f00ac6d51de 100644 (file)
@@ -25,9 +25,9 @@ func ExampleWrite() {
 func ExampleWrite_multi() {
        buf := new(bytes.Buffer)
        var data = []interface{}{
+               uint16(61374),
                int8(-54),
                uint8(254),
-               uint16(48826),
        }
        for _, v := range data {
                err := binary.Write(buf, binary.LittleEndian, v)
@@ -36,7 +36,7 @@ func ExampleWrite_multi() {
                }
        }
        fmt.Printf("%x", buf.Bytes())
-       // Output: cafebabe
+       // Output: beefcafe
 }
 
 func ExampleRead() {