Skip to content

Commit ad74ff6

Browse files
committed
go/gcexportdata: drop support for the ancient binary format
Compilers and tools haven't produced it since go1.11, several years ago now. Change-Id: I5056c5bba81030a2eba5e3931190b8249524aed7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/494442 gopls-CI: kokoro <[email protected]> Run-TryBot: Alan Donovan <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 01128f9 commit ad74ff6

14 files changed

+36
-1948
lines changed

go/gcexportdata/gcexportdata.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,14 @@ func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package,
128128
// (from "version"). Select appropriate importer.
129129
if len(data) > 0 {
130130
switch data[0] {
131-
case 'i':
132-
_, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path)
133-
return pkg, err
131+
case 'v', 'c', 'd': // binary, till go1.10
132+
return nil, fmt.Errorf("binary (%c) import format is no longer supported", data[0])
134133

135-
case 'v', 'c', 'd':
136-
_, pkg, err := gcimporter.BImportData(fset, imports, data, path)
134+
case 'i': // indexed, till go1.19
135+
_, pkg, err := gcimporter.IImportData(fset, imports, data[1:], path)
137136
return pkg, err
138137

139-
case 'u':
138+
case 'u': // unified, from go1.20
140139
_, pkg, err := gcimporter.UImportData(fset, imports, data[1:], path)
141140
return pkg, err
142141

0 commit comments

Comments
 (0)