Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modfile: improve directory path detection and error text consistency
An error text suggests a directory path needs to start with ./ or ../ if it's a relative path, but in reality relative paths with .\ and ..\ prefix (such as those that are used on Windows) are also accepted. Furthermore, a relative path like ./ or ../ is fine, as are ./. and ../., but the cleaner and shorter equivalent relative paths . and .. are reported as if they're not directory paths (even though a module path cannot consist of nothing but dots). Fix those inconsistencies and make IsDirectoryPath report true on "." and ".." paths as expected, and make its documentation clear that a path like "sub/dir", despite being a relative path, is interpreted as a module path. For golang/go#60572. Change-Id: I8fa4a2c66bc83a1ccafc453b96f3bb33dc222cd1 Reviewed-on: https://go-review.googlesource.com/c/mod/+/500335 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information