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/cgo: recognize //go:export like //export #38785

Closed
nd opened this issue May 1, 2020 · 8 comments
Closed

cmd/cgo: recognize //go:export like //export #38785

nd opened this issue May 1, 2020 · 8 comments
Labels
help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nd
Copy link
Contributor

nd commented May 1, 2020

Directives are excluded from extracted docs (#37974). In addition to comments matched by the //[a-z0-9]+:[a-z0-9] pattern, the //line comment is excluded. Maybe the CGO //export comment should be excluded as well.

@mvdan
Copy link
Member

mvdan commented May 1, 2020

I think you meant #37974?

@mvdan mvdan changed the title To exclude CGO //export directive from extracted docs go/doc: exclude CGO //export directive from extracted docs May 1, 2020
@nd
Copy link
Contributor Author

nd commented May 1, 2020

Thanks, fixed

@ianlancetaylor
Copy link
Contributor

@rsc @griesemer Any concerns about handling //export in doc comments as we handle //go: comments? I guess this would be a one-off special case.

Another option would be to migrate toward //go:export comments.

@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 1, 2020
@ianlancetaylor ianlancetaylor added this to the Go1.15 milestone May 1, 2020
@ianlancetaylor
Copy link
Contributor

Setting Go1.15 milestone since this functionality is new in the 1.15 release. It can be done later, though.

@griesemer
Copy link
Contributor

Wouldn't one want to see //export comments in documentation? How would one be able to tell that the marked Go function can be used from C?

But assuming that excluding these comments in the documentation is ok, moving to //go:export would not require another special case which I think would be preferable. The tools would have to recognize both indefinitely (or at least for a some time), but over time the //export comments would disappear in the documentation as code is adjusted. Does that sound about right?

@ianlancetaylor ianlancetaylor changed the title go/doc: exclude CGO //export directive from extracted docs cmd/cgo: recognize //go:export like //export Jun 26, 2020
@ianlancetaylor
Copy link
Contributor

Changing this into a cmd/cgo change to use //go:export.

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Jun 26, 2020
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 26, 2020
@ianlancetaylor ianlancetaylor added help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 26, 2020
@ianlancetaylor ianlancetaylor modified the milestones: Go1.15, Backlog Jun 26, 2020
@gopherbot gopherbot removed the NeedsFix The path to resolution is known, but the work has not been done. label Jun 26, 2020
@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 26, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/240777 mentions this issue: cmd/cgo: recognize //go:export like //export

@jimmyfrasche
Copy link
Member

I filed #68061 as an umbrella proposal which contains this as a special case so I'm closing this issue for now. It may be repopened later if the proposal is rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants