We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init.go: package main import "pckg_a" import "pckg_b" func main() { pckg_a.New() pckg_b.New() src/pckg_a/test.go: package pckg_a import "pckg_b" func New() string { return pckg_b.New() src/pckg_b/test.go: package pckg_b import "pckg_a" func New() string { return pckg_a.New() In the directory containing init.go: GOPATH=`pwd` go build reports init.go:3:8: import cycle not allowed The bug is that it does not actually report the import cycle. If I apply this patch to cmd/go/pkg.go: --- a/src/cmd/go/pkg.go Sun Aug 11 13:05:51 2013 +0400 +++ b/src/cmd/go/pkg.go Mon Aug 26 09:42:19 2013 -0700 @@ -252,7 +252,7 @@ bp.BinDir = gobin } p.load(stk, bp, err) - if p.Error != nil && len(importPos) > 0 { + if p.Error != nil && len(importPos) > 0 && p.Error.Err != "import cycle not allowed" { pos := importPos[0] pos.Filename = shortPath(pos.Filename) p.Error.Pos = pos.String() Then the complete import cycle is reported: package . imports pckg_a imports pckg_b imports pckg_a: import cycle not allowed Recording this issue in the hopes of producing a more sensible patch.
The text was updated successfully, but these errors were encountered:
Comment 1 by atkaaz:
Rob says it's fixed: https://groups.google.com/d/msg/golang-nuts/F5t9VwOMjzc/xrM4YHptVFAJ possibly this commit: http://code.google.com/p/go/source/detail?r=690f8b24e42fbe14e85a8723b65a6391eea5e6d5
Sorry, something went wrong.
Comment 2:
Status changed to Duplicate.
Merged into issue #4292.
No branches or pull requests
The text was updated successfully, but these errors were encountered: