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

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

@yfuruyama yfuruyama requested review from hengfengli, skuruppu and a team as code owners May 19, 2021 07:21
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label May 19, 2021
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label May 19, 2021
Copy link
Contributor

@hengfengli hengfengli left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix!

@hengfengli hengfengli added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 19, 2021
// Prefix string
// Suffix string
// }
// type customField struct {
Copy link
Member

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:

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 19, 2021
@hengfengli hengfengli added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 26, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 26, 2021
@hengfengli
Copy link
Contributor

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

@hengfengli hengfengli merged commit 7c1f48f into googleapis:master May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spanner: Layout of godoc for Encoder/Decoder is broken
4 participants