Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

chores(docs): Move example from markdown to tests #89

Merged
merged 1 commit into from
Feb 25, 2020
Merged

chores(docs): Move example from markdown to tests #89

merged 1 commit into from
Feb 25, 2020

Conversation

mrVanboy
Copy link
Contributor

@mrVanboy mrVanboy commented Feb 23, 2020

It's required because:

  • package users can use godoc.org, pkg.go.dev for exploring
    the package documentation
  • testable examples can be more in sync with actual code

This commit moves examples from the plain markdown to testable
examples. It allows to test examples during test phase and have
them more in sync with actual code. Also the examples can be
shown by documentation servers and in IDEs and make work with
package much more user-friendly as not everyone looks into
README.md at repo's root.

Related to #68

Screenshot of godoc server [collapsible]

image

Ref: Testable Examples in Go - The Go Blog

It's required because:
- package users can use godoc.org, pkg.go.dev for exploring
the package documentation
- testable examples can be more in sync with actual code

This commit moves examples from the plain markdown to testable
examples. It allows to test examples during test phase and have
them more in sync with actual code. Also the examples can be
shown by documentation servers and in IDEs and make work with
package much more user-friendly as not everyone looks into
README.md at repo's root.

Related to #68
@codecov
Copy link

codecov bot commented Feb 23, 2020

Codecov Report

Merging #89 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #89   +/-   ##
=======================================
  Coverage   94.92%   94.92%           
=======================================
  Files          10       10           
  Lines         965      965           
=======================================
  Hits          916      916           
  Misses         27       27           
  Partials       22       22           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ed7817...30c19f6. Read the comment docs.

@mrVanboy mrVanboy marked this pull request as ready for review February 23, 2020 15:33
@mrVanboy mrVanboy requested a review from bxcodec February 23, 2020 15:33
Copy link
Owner

@bxcodec bxcodec left a comment

Choose a reason for hiding this comment

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

LGTM bro, thanks for the PR

@bxcodec bxcodec merged commit 7198e34 into bxcodec:master Feb 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants