Closed
Description
@leitzler reported an infinite loop in the go
command when an import path starts with /
. The stack trace implicates the loop that calls path.Dir
in cmd/go/internal/modload.keepSums
, which terminates on .
. That assumes that the import path is "relative". If the path happens to start with a slash, the path is "absolute" and the fixed point for path.Dir
is /
, not .
, and the loop is infinite.
cc @jayconrod, who added this code in https://golang.org/cl/262781. FWIW, when I wrote a version of this somewhere I did it such that it terminated when path.Dir(s) == s
.