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

fix(spanner): fix layout of godoc for Encoder and Decoder #4128

Merged

Conversation

@yfuruyama
Copy link
Contributor

@yfuruyama yfuruyama commented May 19, 2021

Fix: #4127

I added an additional indent to code sample to fix the layout issue for Encoder/Decoder.

This is a screenshot for the godoc for the fixed code (I used the godoc command to check the fix, so the style of godoc is an old one):

image

Copy link
Contributor

@hengfengli hengfengli left a comment

LGTM. Thanks for the fix!

Loading

// Prefix string
// Suffix string
// }
// type customField struct {
Copy link
Member

@codyoss codyoss May 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It would be nice to turn these into a first class godoc example. Here is an example from the storage library:

Loading

Copy link
Contributor

@hengfengli hengfengli May 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if this is a good case for that. There are two reasons to put in this way:

  • The first class godoc example seems to be a main function to guide users how to use the api. Here we just want to show how to implement the interfaces.
  • The example can be close to the code. Probably better in the comment instead of jumping to another file.

Loading

Copy link
Contributor Author

@yfuruyama yfuruyama May 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for suggestion! This example contains a type definition and method definition, so if I understand correctly, we need a separate file to turn this into first class godoc example.

For example, sort package has a similar example for Example (SortWrapper) by this code. I'm wondering if I should do similar thing for this example.

Loading

@hengfengli
Copy link
Contributor

@hengfengli hengfengli commented May 26, 2021

I'll merge this in first. We can improve the doc later if necessary.

Loading

@hengfengli hengfengli merged commit 7c1f48f into googleapis:master May 26, 2021
3 checks passed
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants