cmd/go: using newer standard library APIs with an incompatible go version in go.mod does not produce error #47802
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
When using standard library APIs added in 1.17 (
Time.UnixMilli()
in my case), I had hoped that the toolchain would ask me to update thego
directive in the go mod file, exactly as it did when addinggo:embed
directives.reproduction case: https://github.com/bmon/go-mod-time-version/tree/75f34ebbfdc044550c5577a7aef3b86fc7547216
What did you expect to see?
I thought that the toolchain would ask me to modify the go version, exactly as it did with usage of
go:embed
What did you see instead?
The module builds, and passes
go mod tidy
andgo mod vet
without any issue, despite incorrectly setting the go version in the mod file.Apologies if this is a duplicate, I spent some time searching but I wasn't able to find an issue matching this request. The closest I found was #30241
The text was updated successfully, but these errors were encountered: