diff --git a/go/packages/golist.go b/go/packages/golist.go index ff42de486bd..dfaeed85021 100644 --- a/go/packages/golist.go +++ b/go/packages/golist.go @@ -113,7 +113,8 @@ extractQueries: if sizeserr != nil { return nil, sizeserr } - response.Sizes = sizes + // types.SizesFor always returns nil or a *types.StdSizes + response.Sizes, _ = sizes.(*types.StdSizes) if len(containFiles) == 0 && len(packagesNamed) == 0 { return response, nil diff --git a/go/packages/packages.go b/go/packages/packages.go index 7d713fc7e84..d359a33af1c 100644 --- a/go/packages/packages.go +++ b/go/packages/packages.go @@ -138,7 +138,7 @@ type driver func(cfg *Config, patterns ...string) (*driverResponse, error) // driverResponse contains the results for a driver query. type driverResponse struct { // Sizes, if not nil, is the types.Sizes to use when type checking. - Sizes types.Sizes + Sizes *types.StdSizes // 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