Navigation Menu

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

go/doc: annotate types that contain sync values #8795

Closed
josharian opened this issue Sep 23, 2014 · 2 comments
Closed

go/doc: annotate types that contain sync values #8795

josharian opened this issue Sep 23, 2014 · 2 comments

Comments

@josharian
Copy link
Contributor

godoc could automatically flag structs containing sync values. This would prevent
situations like issue #8794 from arising.

Open questions:

1. Worth it?
2. Flag all structs with sync value fields, or only structs containing unexported sync
value fields?
3. What does the godoc output look like (command line + http)?

My instinct is:

1. Yes.
2. All.
3. Append a paragraph to the end of the type's doc saying (roughly) "T contains a
sync value and should not be copied.", to be rendered as appropriate for the medium.

Input requested.
@griesemer
Copy link
Contributor

Comment 1:

Exported data structures containing locks should be adequately documented by the author
of the package.
I am not against having godoc mark structs with locks (doing it right requires full type
info); but the question arises, where do we stop? For instance, what about structs
containing shared data structures? File descriptors? Fundamentally they have the same
problem.

@josharian
Copy link
Contributor Author

Comment 2:

Between rsc's comment on 8794 and the need for full type info, I think I was wrong about
this being a good idea. Thanks!

Labels changed: added release-none, removed release-go1.5.

Status changed to Retracted.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
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

3 participants