Skip to content

cmd/compile: build tags don't respect the go version in go.mod #47259

@OneOfOne

Description

@OneOfOne

This mainly applies to dev.typeparams since everything breaks if you use generics and go.mod isn't set to 1.18, however I tested with tip and go1.16 and the same issue happens.

To reproduce:

  • go.mod
module x

go 1.15
  • main.go
package main

func main() {
        println(Version)
}
  • main_go115.go
//go:build !go1.16
// +build !go1.16

package main

const Version = "1.15"
  • main_go116.go
//go:build go1.16
// +build go1.16

package main

const Version = "1.16"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions