Skip to content

Docs improvments#89

Merged
ksysoev merged 2 commits into
mainfrom
docs_improvments
Jun 29, 2026
Merged

Docs improvments#89
ksysoev merged 2 commits into
mainfrom
docs_improvments

Conversation

@ksysoev

@ksysoev ksysoev commented Jun 29, 2026

Copy link
Copy Markdown
Owner

This pull request improves the documentation and code clarity for the anycache library, focusing on clearer API descriptions, enhanced onboarding for new users, and more robust example code. The changes also add a Redis backend example and improve error handling in example tests.

Documentation and API Clarity:

  • Updated the README.md to better explain what anycache is, who should use it, when not to use it, and its core behaviors (e.g., singleflight deduplication, warm-up semantics, and lifecycle expectations). Added sections for alternatives and release notes. [1] [2]
  • Improved Go doc comments throughout the codebase for all public APIs, making their behavior and intent clearer for users. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Examples and Onboarding:

  • Added a section in the README.md pointing to onboarding examples, including the anycache_example_test.go file and pkg.go.dev.
  • Introduced a Redis backend example in anycache_example_test.go and ensured all examples handle errors robustly (panic on error), making them safer for copy-paste and easier to follow for new users. [1] [2] [3] [4] [5] [6] [7]

Code Quality and Consistency:

  • Standardized error handling in all example functions to panic on error, ensuring that test failures are obvious and reducing silent failures in onboarding scenarios. [1] [2] [3] [4] [5] [6] [7]

These improvements make the library easier to understand, adopt, and integrate, especially for teams new to anycache or cache-aside patterns.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves developer-facing documentation and example code for the anycache Go library, clarifying key API semantics (warm-up, singleflight scope, context/timeout behavior) and making the onboarding examples safer to copy/paste by handling errors explicitly.

Changes:

  • Expanded README.md with clearer positioning (who/when), detailed semantics, and links to runnable onboarding examples.
  • Refined Go doc comments across public APIs/options to better describe behavior and expectations.
  • Updated and extended anycache_example_test.go with explicit error handling and a Redis backend setup example.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
request_options.go Clarifies WithWarmUpTTL option documentation.
README.md Adds/rewrites sections for semantics, adoption guidance, and example links.
cache_options.go Tightens option doc comments (TTL randomization, key prefix, base context, metrics hook).
anycache.go Improves package/API doc comments for exported types and methods.
anycache_example_test.go Makes examples fail loudly on errors and adds Redis backend setup example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ksysoev ksysoev merged commit 203c8b2 into main Jun 29, 2026
3 checks passed
@ksysoev ksysoev deleted the docs_improvments branch June 29, 2026 05:36
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.

Polish README, public docs, examples, and release framing before announcement

2 participants