]> Cypherpunks repositories - gostls13.git/commit
cmd/go: diagnose import cycles better
authorRob Pike <r@golang.org>
Mon, 19 Aug 2013 05:50:57 +0000 (15:50 +1000)
committerRob Pike <r@golang.org>
Mon, 19 Aug 2013 05:50:57 +0000 (15:50 +1000)
commitc974b8b6ac01df39fb436995939503febb9190ef
tree71171f4a20f1495c38b017bd0f6d52846d6fd9a0
parenta790388afb85f04ed65d3795eb22edee44df69af
cmd/go: diagnose import cycles better

Before this CL, the import stack was a) not printed and b) overwritten later
in the build, destroying the information about the cycle. This CL fixes both.

I made time depend on os (os already depends on time) and with this CL the error is:

/Users/r/go/src/pkg/fmt/print.go:10:2: import cycle not allowed
package code.google.com/p/XXX/YYY:
        imports fmt
        imports os
        imports time
        imports os

Doesn't give line numbers for the actual imports, as requested in the bug, but
I don't believe that's important.

Fixes #4292.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13100043
src/cmd/go/pkg.go