Import path is a '/'-separated path. FromDir documentation says on return, root is the import path corresponding to the root of the repository. On Windows and other OSes where os.PathSeparator is not '/', that wasn't true since root would contain characters other than '/', and therefore it wasn't a valid import path corresponding to the root of the repository. Fix that by using filepath.ToSlash. Add test coverage for root value returned from FromDir, it was previously not tested. Additionally, remove a dubious statement from the documentation "(thus root is a prefix of importPath)". There is no variable importPath that is being referred to. It's also redundant and confusing. Without it, the description of root value matches the documentation of RepoRoot.Root struct field: // Root is the import path corresponding to the root of the // repository. Root string Fixes golang/go#7723. Change-Id: If9f5f55b5751e01a7f88b79d9b039402af3e9312 Reviewed-on: https://go-review.googlesource.com/18461 Reviewed-by: Chris Manghane <cmang@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> |
||
|---|---|---|
| benchmark/parse | ||
| blog | ||
| cmd | ||
| container/intsets | ||
| cover | ||
| go | ||
| godoc | ||
| imports | ||
| oracle | ||
| playground | ||
| present | ||
| refactor | ||
| .gitattributes | ||
| .gitignore | ||
| AUTHORS | ||
| CONTRIBUTING.md | ||
| CONTRIBUTORS | ||
| LICENSE | ||
| PATENTS | ||
| README | ||
| codereview.cfg | ||
README
This subrepository holds the source for various packages and tools that support the Go programming language. Some of the tools, godoc and vet for example, are included in binary Go distributions. Others, including the Go oracle and the test coverage tool, can be fetched with "go get". Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs. To submit changes to this repository, see http://golang.org/doc/contribute.html.