Conversation
noahdietz
reviewed
Sep 14, 2020
| outDir := flag.String("out", "obj/api", "Output directory (default obj/api)") | ||
| flag.Parse() | ||
| if flag.NArg() != 1 { | ||
| log.Fatalf("%s expected 1 arg, got %d", os.Args[0], flag.NArg()) |
Contributor
There was a problem hiding this comment.
Nit: could this error message be improved? %s missing required argument: module path
codyoss
reviewed
Sep 14, 2020
| pages := map[string]*page{} | ||
| toc := tableOfContents{} | ||
|
|
||
| module := pkgs[0].Module |
Member
There was a problem hiding this comment.
Will at least one pkg always exist?
Contributor
Author
There was a problem hiding this comment.
Yes. len(pkgs) == 0 is checked above.
codyoss
reviewed
Sep 14, 2020
tbpg
commented
Sep 14, 2020
Contributor
Author
tbpg
left a comment
There was a problem hiding this comment.
Thanks! Please take another look.
| outDir := flag.String("out", "obj/api", "Output directory (default obj/api)") | ||
| flag.Parse() | ||
| if flag.NArg() != 1 { | ||
| log.Fatalf("%s expected 1 arg, got %d", os.Args[0], flag.NArg()) |
| pages := map[string]*page{} | ||
| toc := tableOfContents{} | ||
|
|
||
| module := pkgs[0].Module |
Contributor
Author
There was a problem hiding this comment.
Yes. len(pkgs) == 0 is checked above.
|
FYI, there is a tracking issue golang/go#39883 for making that API available to for external use; mentioning it here so that this use case can be considered as part of that work. You may also want to leave a 👍 reaction and/or subscribe to it. |
Contributor
Author
|
Thanks! I gave a 👍 to golang/go#39883. |
codyoss
approved these changes
Sep 15, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a some code copied from https://github.com/golang/pkgsite for getting type/function synopses. Because of those license headers, I put the code in
third_party.I included a script we can hopefully use from a Kokoro job. That shows how the generator is intended to be used.
Eventually, we may publish this as a standalone tool. We may end up wanting to publish docs for other modules (outside google-cloud-go). It's also possible others in the community would be interested.
cc @dmitshur @julieqiu @JustinBeckwith @spf13 @SurferJeffAtGoogle @jskeet