You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation of cmd/go has a section on import path checking that currently says:
A package statement is said to have an "import comment" if it is immediately followed (before the next newline) by a comment of one of these two forms:
package math // import "path"
package math /* import "path" * /
Note the space in the closing * /. What the documentation is trying to say is actually */, but due to a technical limitation it says something else instead. The problem is that including a */ inside the package comment would end it short, causing alldocs.go file to have syntax errors:
The end result is that documentation (specification) of import comments can be confusing, especially for beginners. The documentation should be truthful and say:
... a comment of one of these two forms:
package math // import "path"
package math /* import "path" */
I propose fixing this by using line comments rather than general comments (also known as block comments) for the generated documentation in alldocs.go. Line comments scale better and can include any characters. General comments cannot contain */ character sequence.
I have it implemented, I will submit a CL that resolves this soon.
The text was updated successfully, but these errors were encountered:
The documentation of
cmd/go
has a section on import path checking that currently says:Note the space in the closing
* /
. What the documentation is trying to say is actually*/
, but due to a technical limitation it says something else instead. The problem is that including a*/
inside the package comment would end it short, causingalldocs.go
file to have syntax errors:go/src/cmd/go/alldocs.go
Line 1268 in fee02d2
The end result is that documentation (specification) of import comments can be confusing, especially for beginners. The documentation should be truthful and say:
I propose fixing this by using line comments rather than general comments (also known as block comments) for the generated documentation in
alldocs.go
. Line comments scale better and can include any characters. General comments cannot contain*/
character sequence.I have it implemented, I will submit a CL that resolves this soon.
The text was updated successfully, but these errors were encountered: