From a832035fe553cf32b3cf3fd083ca8d4ec067f36d Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 26 Aug 2016 13:44:43 -0700 Subject: [PATCH] go/gcimporter15: update to match latest changes to cmd/compiler exporter Backport of https://go-review.googlesource.com/27814 changes to bexport.go. With this, the gcimporter15 is again up-to-date and in sync with both the compiler's export code, and the compiler's and std lib gcimporter's import code. Change-Id: I8e229660eb78ddc1506b7b96a89c81ff083e0412 Reviewed-on: https://go-review.googlesource.com/27914 Reviewed-by: Matthew Dempsky --- go/gcimporter15/bexport.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/go/gcimporter15/bexport.go b/go/gcimporter15/bexport.go index 9208367f..fc569e4f 100644 --- a/go/gcimporter15/bexport.go +++ b/go/gcimporter15/bexport.go @@ -40,9 +40,8 @@ const debugFormat = false // default: false // If trace is set, debugging output is printed to std out. const trace = false // default: false -// Current export format version. -// Must not start with 'c' or 'd' (initials of prior format). -const exportVersion = "version 1" +// Current export format version. Increase with each format change. +const exportVersion = 1 // trackAllTypes enables cycle tracking for all types, not just named // types. The existing compiler invariants assume that unnamed types @@ -86,7 +85,10 @@ func BExportData(fset *token.FileSet, pkg *types.Package) []byte { } // write version info - p.rawStringln(exportVersion) + // The version string must start with "version %d" where %d is the version + // number. Additional debugging information may follow after a blank; that + // text is ignored by the importer. + p.rawStringln(fmt.Sprintf("version %d", exportVersion)) var debug string if debugFormat { debug = "debug"