Skip to content

cmd/go: "import cycle not allowed in test" message shows wrong stack #59970

Closed
@rsc

Description

@rsc
% cd go/src/internal/godebug
% echo 'package godebug; import _ "testing"' >g_test.go
% go test
# internal/godebug
package internal/godebug
	imports math/rand
	imports testing: import cycle not allowed in test
FAIL	internal/godebug [setup failed]
% 

The error is incorrect (the imports it reports are reversed from reality) and incomplete (it doesn't complete the cycle). It should say something like:

package internal/godebug
	imports testing
	imports math/rand
	imports internal/godebug: import cycle not allowed in test
FAIL	internal/godebug [setup failed]

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeGoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions