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: support custom output format #41744

CAFxX opened this issue Oct 2, 2020 · 2 comments

cmd/doc: support custom output format #41744

CAFxX opened this issue Oct 2, 2020 · 2 comments
FeatureRequest NeedsInvestigation


Copy link

@CAFxX CAFxX commented Oct 2, 2020

What version of Go are you using (go version)?


Does this issue reproduce with the latest release?


What operating system and processor architecture are you using (go env)?


What did you do?

I am using go doc to automatically generate static documentation for internal repositories.

What did you expect to see?

A way to provide a text/template to control the output format or, alternatively, a way to output the data in a standard machine-parseable format (e.g. json, yaml, ...) that I can use to drive custom output generation.

What did you see instead?

go doc does only provide a single format for direct human consumption.

@CAFxX CAFxX changed the title cmd/doc: add support for templates cmd/doc: support custom output format Oct 2, 2020
Copy link

@robpike robpike commented Oct 2, 2020

The program really wasn't written with that in mind. It might be convertible but it would be a lot of work. You'd likely be better off hacking up something using go/doc directly.

@dmitshur dmitshur added FeatureRequest NeedsInvestigation labels Oct 6, 2020
@dmitshur dmitshur added this to the Unplanned milestone Oct 6, 2020
Copy link

@icholy icholy commented May 19, 2021

I used the (now changed) godoc -templates flag to implement go doc tab completion for zsh:

It's unfortunate that there's no alternative with the current tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
FeatureRequest NeedsInvestigation
None yet

No branches or pull requests

4 participants