New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/mod/module: document that non-short Windows names not allowed in module paths #47493
Comments
This seems to be working as documented/intended? CheckFilePath passes: https://play.golang.org/p/8u7pObwsxjX While the other 2 are documented to reject such paths:
|
You're right.
Yes, they are documented but in my opinion the original commit 4ab6fb1 that introduced this check was too restrictive and rejects path that are as documented but are not short-names in Windows. |
Is there a specific reason we would need to allow these paths? (Are there existing widely-used packages that rely on them?) I agree that the check may be somewhat more conservative than is strictly necessary, but I don't see a significant harm in leaving it that way. |
A part from that it may be somewhat more conservative, there is not a specific reason. Having understood that this implementation is a deliberate choice, it is okay for me to close this issue. However, I recommend mentioning the short-name requirements in the documentation on the page https://golang.org/ref/mod#go-mod-file-ident Having to implement a module path validator, without using existing code, I went from this documentation to the code implementing it without reading the |
Change https://golang.org/cl/344569 mentions this issue: |
Fixes golang/go#47493 Change-Id: I97d929e646b107766ed44f9bd120ab07e15429e4 Reviewed-on: https://go-review.googlesource.com/c/website/+/344569 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
The
CheckPath
,CheckImportPath
andCheckFilePath
functions (used to check module, import and file paths) reject Window short files (asTHISIS~1.TXT
) but also reject paths likethis-is-a-long-file-path~1
andthis-is-a-long-file-path~1.txt
.A short file name can have at most 8 characters before the dot and its extension can have at most 3 characters.
The text was updated successfully, but these errors were encountered: