summaryrefslogtreecommitdiff
path: root/src/encoding/binary/example_test.go
Commit message (Collapse)AuthorAgeFilesLines
* all: simplify code using "gofmt -s -w"Shulhan2019-05-061-15/+15
| | | | | | | | | | | | | | | | | | Most changes are removing redundant declaration of type when direct instantiating value of map or slice, e.g. []T{T{}} become []T{{}}. Small changes are removing the high order of subslice if its value is the length of slice itself, e.g. T[:len(T)] become T[:]. The following file is excluded due to incompatibility with go1.4, - src/cmd/compile/internal/gc/ssa.go Change-Id: Id3abb09401795ce1e6da591a89749cba8502fb26 Reviewed-on: https://go-review.googlesource.com/c/go/+/166437 Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* encoding/binary: make new example a bit more idiomaticRuss Cox2017-11-151-6/+8
| | | | | | | | | | | Mainly get rid of the weird zero-value struct literal, but while we're here also group and order things a bit better: first the reader, then the data, then the call (which takes reader then data). Change-Id: I901b0661d85d8eaa0807e4482aac66500ca996c7 Reviewed-on: https://go-review.googlesource.com/78118 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
* encoding/binary: add example for Read multiMark Wolfe2017-08-121-0/+24
| | | | | | | | Change-Id: I27ff99aa7abb070f6ae79c8f964aa9bd6a83b89d Reviewed-on: https://go-review.googlesource.com/53730 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* encoding/binary: add examples for varint functionsAxel Wagner2017-08-031-0/+91
| | | | | | | | Change-Id: I191f6e46b452fadde9f641140445d843b0c7d534 Reviewed-on: https://go-review.googlesource.com/48604 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* encoding/binary: add examples for ByteOrder functionsRoss Light2017-07-151-0/+18
| | | | | | | Change-Id: Iec9a7bf61566ee08c4d15adb39d43c7a29c79122 Reviewed-on: https://go-review.googlesource.com/48962 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
* all: make copyright headers consistent with one space after periodBrad Fitzpatrick2016-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | This is a subset of https://golang.org/cl/20022 with only the copyright header lines, so the next CL will be smaller and more reviewable. Go policy has been single space after periods in comments for some time. The copyright header template at: https://golang.org/doc/contribute.html#copyright also uses a single space. Make them all consistent. Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0 Reviewed-on: https://go-review.googlesource.com/20111 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* build: move package sources from src/pkg to srcRuss Cox2014-09-081-0/+52
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.