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

Improve godoc output #250

Merged
merged 13 commits into from
Jun 18, 2020
Merged

Improve godoc output #250

merged 13 commits into from
Jun 18, 2020

Conversation

rhcarvalho
Copy link
Contributor

One step towards better godoc output / better docs at godoc.org; not perfect.

Before

No package overview:

image

Sometimes messy output on the console:

image

After

Basic package overview:

image

Better output on the console:

image

Unlike other documentation tools, godoc does not parse markdown syntax.
In Go, documentation comments are simple sentences with no added markup.

See https://blog.golang.org/godoc.
- It is irrelevant to explain "how" the SDK is initialized (no need to
talk about Client and Hub -- those interested in the details will read
the source code).
- Document when the returned error is non-nil. Many people might ignore
the error, so it is at least a start to document when initializing the
SDK might fail.
Note that gocertifi was removed long ago in v0.0.1-beta.3.
- Group related constants together so that we can introduce them all
with a single comment, producing cleaner godoc output.
- Clean up doc comments of unexported values.
Fixes a typo "atleast" by rewriting and making the comment more concise.
Sometimes globals make sense.

We do use globals intentionally, and the linter has not stopped us from
doing so.

The comments to disable the linter unfortunately end up in godoc output
as additional noise, thus this commit removes it as part of making godoc
output look better.
@rhcarvalho
Copy link
Contributor Author

Inspired by #239 / #245.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

🚀

@rhcarvalho rhcarvalho merged commit 19b581d into getsentry:master Jun 18, 2020
@rhcarvalho rhcarvalho deleted the godoc branch June 18, 2020 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants