Skip to content

x/tools/go/packages: type-checker uses incorrect type sizes function #28179

Closed
@alandonovan

Description

@alandonovan

The go/types.Config struct has a Sizes field that specifies the function that the type checker should use to compute the size of a type. This function is itself a function of the CPU architecture and potentially the OS or toolchain as well. Only the underlying build system (go list, blaze, bazel) knows authoritatively what size to use, so go/packages should obtain this information from the build system rather than guessing based on GOARCH as it does now. One way to do this is to ask the underlying build system to compile a tiny program and inspect the compiler output.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions