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
proposal: cmd/godoc: parameter/return field #18897
Comments
Suggestion/question: couldn't go lint be changed to complain if explanations for the parameters are omitted? |
Revently, I deliver products written in Go for my customers with godoc documentation. The documentation is written in english currently. godoc is beautiful look to see documentation. However all of programmers cannnot write english in the world. As I said in above, In additional, godoc accept to write in free style. So often, I forgot to add description of new parameters. As @ericlagergren said, varidator will be useful to check whether the documentation is broken. |
I say again, I don't want to add complying. Just want to add
|
There is a hook in the packages that godoc uses that can be used to turn all references to certain names into code font, so that parameters can be shown in a separate font. But it's unclear if that's sufficient for your needs. We don't want to add explicit markup, like |
I think godoc could definitely help more here.
For example, assuming the docs is not too long, that is, all the docs and
the function prototype are displayed in the screen, then we can make godoc
highlight the argument when the mouse pointer hovers over the name of the
argument in the docs.
However, this might not help if the argument name is too common a word, and
are "used" in the docs for purposes other than referring to the argument.
|
@rsc this isn't my issue, but I'd appreciate having parameter names be in |
As noted before, one of the first principles of godoc comments is to avoid markup like |
In sometimes, I hope to know the meaning of function parameters in source code. However, most of godoc(s) comment are just explaining abridgely like
// XXX create Writer from w
. This often makes confusing especially for non-english speakers. So I hope to add syntax to make documentation like doxygen or javadoc in godoc comment.Note: I give you due warning, I don't mean that all of go codes must be complying this syntax. Just providing way to create useful documentation.
godoc command generate html table tag from the parameter/return directives. I know that you have many different opinions about this. Someone doesn't like this syntax. And maybe it need more syntax is needed. However, this may be useful to read/write documentation, and know what the parameter/return value is meaning, I guess.
Thanks.
The text was updated successfully, but these errors were encountered: