Skip to content
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

cmd/doc: const block comments apear after the const block in the generated docs #12533

Closed
kostya-sh opened this issue Sep 7, 2015 · 4 comments

Comments

@kostya-sh
Copy link
Contributor

Example:

Source (comment before the const block): http://golang.org/src/crypto/x509/pem_decrypt.go?s=472:490#L13

// Possible values for the EncryptPEMBlock encryption algorithm.
const (
    _ PEMCipher = iota
    PEMCipherDES
...

Docs: http://golang.org/pkg/crypto/x509/#PEMCipher

More examples:

@davecheney
Copy link
Contributor

@kostya-sh all comments are presented after the block they are attached too, not just consts.

@kostya-sh
Copy link
Contributor Author

@davecheney, it could be the way godoc works now, but I believe it is not intuitive (at least for consts). Docs for const blocks like http://golang.org/pkg/math/big/#RoundingMode clearly demonstrate it.

const(
ToNearestEven RoundingMode = iota // == IEEE 754-2008 roundTiesToEven
ToNearestAway // == IEEE 754-2008 roundTiesToAway
....
)
The following rounding modes are supported.

The following example doesn't look right ;)

@robpike
Copy link
Contributor

robpike commented Sep 7, 2015

Working as intended. The descriptions are presented after the items.

@robpike robpike closed this as completed Sep 7, 2015
@kostya-sh
Copy link
Contributor Author

Should documentation for some const blocks be re-worded instead? It looks ok in the source code but not in the generated HTML. Examples:

@golang golang locked and limited conversation to collaborators Sep 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants