cmd/go/internal/module: define fs-safe module path encoding
Module paths, like import paths, are case-sensitive, for better or worse. But not all file systems distinguish file paths with different cases. If we are going to use module paths to construct file system paths, we must apply an encoding that distinguishes case without relying upon the file system to do it. This CL defines that encoding, the "safe module path encoding". Module paths today are ASCII-only with limited punctuation, so the safe module path encoding is to convert the whole path to lower case and insert an ! before every formerly upper-case letter: github.com/Sirupsen/logrus is stored as github.com/!sirupsen/logrus. Although this CL defines the encoding, it does not change the rest of the go command to use the encoding. That will be done in follow-up CLs. Change-Id: I06e6188dcfcbbc1d88674f7c95e1cb45cb476238 Reviewed-on: https://go-review.googlesource.com/124378 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Showing
This diff is collapsed.
Please register or sign in to comment