Skip to content

cmd/go: module's "go" version should be included in cache key #37804

@bcmills

Description

@bcmills

The following test case fails, because the second go build succeeds.

It should not: the change in go version should revoke the “duplicate interface method” support added in Go 1.14.

I suspect that we are not including the go version in the cache key. We should.

CC @jayconrod @matloob @jadekler @davecheney

go build .
go mod edit -go=1.13
go build .
stderr '^./main.go:7:2: duplicate method Close$'

-- go.mod --
module play.golang.org/main

go 1.14
-- main.go --
package main

import "io"

type ReadWriteCloser interface {
        io.ReadCloser
        io.WriteCloser
}

func main() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions