aboutsummaryrefslogtreecommitdiff
path: root/src/internal/pkgbits/encoder.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2022-03-01 12:58:20 -0800
committerMatthew Dempsky <mdempsky@google.com>2022-03-01 22:02:33 +0000
commitd40e7bb1744507be421b80c19372b9411c9856b4 (patch)
tree685ef50c251e013ec7f4b37587555c21d87aca33 /src/internal/pkgbits/encoder.go
parentb0db2f00a0d540c3d3f5d14433da2e3e1ad41f9f (diff)
downloadgo-d40e7bb1744507be421b80c19372b9411c9856b4.tar.xz
internal/pkgbits: add version number
Especially once this code gets copied into x/tools, we need a way to evolve the file format, so add an explicit version number. Change-Id: I9cc2e357c3ca3f07fd8d0c0ba4e4a95f89edeac6 Reviewed-on: https://go-review.googlesource.com/c/go/+/388914 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/internal/pkgbits/encoder.go')
-rw-r--r--src/internal/pkgbits/encoder.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/internal/pkgbits/encoder.go b/src/internal/pkgbits/encoder.go
index 87ef50ed8b..820c707940 100644
--- a/src/internal/pkgbits/encoder.go
+++ b/src/internal/pkgbits/encoder.go
@@ -35,6 +35,8 @@ func (pw *PkgEncoder) DumpTo(out io.Writer) {
assert(binary.Write(out, binary.LittleEndian, x) == nil)
}
+ writeUint32(0) // version
+
var sum uint32
for _, elems := range &pw.elems {
sum += uint32(len(elems))