Skip to content

cmd/go: missing version diagnostic when a package in the main module imports a package from a newer release #48966

Closed
@andig

Description

@andig

Given

module example.com/M

go 1.16

and using embed as part of that module, I'm experiencing a lot of user's questions where compilation fails due to go versions below 1.16. Having declared dependency on go1.16 syntax/libraries as part of go.mod it would be nice if the compiler would fail if the module version of the main module or it's dependencies are not met during build. It could be optional behaviour behind a flag.

I realise this might cause breakage for modules who's authors use the highes available go version as part of their go.mod to be "compatible", but that approach seems flawed anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions