fix: type sizing when cross-compiling (32-bit) (#5053)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
Gavin Li 2024-10-03 16:33:16 -04:00 committed by GitHub
parent 094668e305
commit a86d8baa53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"go/ast"
"go/build"
"go/parser"
"go/scanner"
"go/types"
@ -164,6 +165,7 @@ func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error {
pkg.Errors = append(pkg.Errors, lp.convertError(err)...)
},
GoVersion: rv, // TODO(ldez) temporary workaround
Sizes: types.SizesFor(build.Default.Compiler, build.Default.GOARCH),
}
_ = types.NewChecker(tc, pkg.Fset, pkg.Types, pkg.TypesInfo).Files(pkg.Syntax)