diff --git a/go/tools/gopackagesdriver/json_packages_driver.go b/go/tools/gopackagesdriver/json_packages_driver.go index 9bbf34081a..d91f2ed114 100644 --- a/go/tools/gopackagesdriver/json_packages_driver.go +++ b/go/tools/gopackagesdriver/json_packages_driver.go @@ -16,7 +16,7 @@ package main import ( "fmt" - "go/types" + "runtime" ) type JSONPackagesDriver struct { @@ -52,7 +52,8 @@ func (b *JSONPackagesDriver) GetResponse(labels []string) *driverResponse { return &driverResponse{ NotHandled: false, - Sizes: types.SizesFor("gc", "amd64").(*types.StdSizes), + Compiler: "gc", + Arch: runtime.GOARCH, Roots: rootPkgs, Packages: packages, } diff --git a/go/tools/gopackagesdriver/main.go b/go/tools/gopackagesdriver/main.go index fea2d2c141..8cc904d3ce 100644 --- a/go/tools/gopackagesdriver/main.go +++ b/go/tools/gopackagesdriver/main.go @@ -18,8 +18,8 @@ import ( "context" "encoding/json" "fmt" - "go/types" "os" + "runtime" "strings" ) @@ -31,8 +31,10 @@ type driverResponse struct { // lists of multiple drivers, go/packages will fall back to the next driver. NotHandled bool - // Sizes, if not nil, is the types.Sizes to use when type checking. - Sizes *types.StdSizes + // Compiler and Arch are the arguments pass of types.SizesFor + // to get a types.Sizes to use when type checking. + Compiler string + Arch string // Roots is the set of package IDs that make up the root packages. // We have to encode this separately because when we encode a single package @@ -63,7 +65,8 @@ var ( additionalKinds = strings.Fields(os.Getenv("GOPACKAGESDRIVER_BAZEL_KINDS")) emptyResponse = &driverResponse{ NotHandled: true, - Sizes: types.SizesFor("gc", "amd64").(*types.StdSizes), + Compiler: "gc", + Arch: runtime.GOARCH, Roots: []string{}, Packages: []*FlatPackage{}, }