Skip to content

cmd/go: import paths can contain the .test suffix, breaking the toolchain #60454

@dominikh

Description

@dominikh

What version of Go are you using (go version)?

$ go version
go version devel go1.21-231f290e51 Sat Apr 8 05:25:04 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Given

-- foo/foo.go --
package foo

import _ "example.com/foo.test"
-- foo/foo_test.go --
package foo
-- foo.test/bar.go --
package bar
-- go.mod --
module example.com

go 1.21

run go test ./foo

What did you expect to see?

One of

  • no error
  • an explanation for the error
  • an explicit error forbidding using foo.test as an import path

What did you see instead?

/home/dominikh/prj/go/pkg/tool/linux_amd64/link: fingerprint mismatch: example.com/foo.test has 36b962da8ceb542c, import from example.com/foo expecting aa419b4c2ff8e5ed

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions