Skip to content

docs(go): add runnable examples folder - #7

Merged
Mukbeast4 merged 1 commit into
mainfrom
feature/examples-folder
Apr 24, 2026
Merged

docs(go): add runnable examples folder#7
Mukbeast4 merged 1 commit into
mainfrom
feature/examples-folder

Conversation

@Mukbeast4

Copy link
Copy Markdown
Owner

What

Adds examples/ with seven standalone main packages demonstrating the public API, plus a top-level examples/README.md index.

Example Focus
quickstart cells + SUM formula + save
formulas SUM/AVERAGE/MEDIAN/MAX/IF + RecalcAll
styling NewStyle with fonts, fills, borders, rotation + Range chain
autofilter SetAutoFilter + SetFilterCriteria + SetSort
streaming 10k rows via AppendRows in batches + NewRowIterator
roundtrip open -> mutate counter -> save (file cleaned up after)
images embed a 1x1 PNG anchored to B2

Why

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

  • Invoke any example via go run ./examples/<name> from the repo root.
  • Generated .ods files land in the cwd; roundtrip cleans up its own file.
  • Main README gains a short "Examples" section with the list.

Test plan

  • go build ./... passes (all examples compile)
  • go run ./examples/<name> produces a valid ODS for each of the 7 samples
  • Open a generated ODS in LibreOffice Calc and confirm it renders (manual)

### 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.
@Mukbeast4
Mukbeast4 merged commit c1f5ff1 into main Apr 24, 2026
2 checks passed
@Mukbeast4
Mukbeast4 deleted the feature/examples-folder branch April 24, 2026 11:20
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.

1 participant