docs(go): add runnable examples folder - #7
Merged
Conversation
### What Adds examples/ with 7 standalone main packages demonstrating the public API, plus a top-level examples/README.md index: - quickstart: typed cells + SUM formula + save - formulas: multiple aggregation functions + RecalcAll - styling: NewStyle with fonts, fills, borders, rotation + Range - autofilter: SetAutoFilter + SetFilterCriteria + SetSort - streaming: AppendRows in batches + NewRowIterator - roundtrip: open -> mutate counter -> save - images: embed a 1x1 PNG with AddImageFromBytes ### Why Previously the only usage references lived inline in README.md. Runnable examples let users copy-paste and verify behavior, and they also act as executable documentation that cannot silently drift out of sync with the code (it would fail to build). ### Notes - Each example is invoked via `go run ./examples/<name>`. - Generated ODS files land in the cwd; roundtrip cleans up its own file. - README.md gains an "Examples" section linking to the new folder.
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.
What
Adds
examples/with seven standalonemainpackages demonstrating the public API, plus a top-levelexamples/README.mdindex.quickstartformulasstylingautofilterstreamingroundtripimagesWhy
Previously the only usage references lived inline in the README. Runnable examples let users copy-paste a working program and also act as executable documentation that cannot silently drift out of sync with the code: any API change that breaks the examples will fail
go build ./...in CI.Notes
go run ./examples/<name>from the repo root..odsfiles land in the cwd;roundtripcleans up its own file.Test plan
go build ./...passes (all examples compile)go run ./examples/<name>produces a valid ODS for each of the 7 samples