mirror of
https://github.com/golang/go
synced 2024-11-19 00:34:40 -07:00
5804fef4c0
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> |
||
---|---|---|
.. | ||
discovery.go | ||
env.go | ||
http.go | ||
vcs_test.go | ||
vcs.go |