Skip to content

docs: add yqlib API usage example to README - #2907

Open
victorwon2001 wants to merge 1 commit into
mikefarah:masterfrom
victorwon2001:fix/issue-2021
Open

victorwon2001 wants to merge 1 commit into
mikefarah:masterfrom
victorwon2001:fix/issue-2021

Conversation

@victorwon2001

Copy link
Copy Markdown

AI disclosure: an automated workflow using gpt-6-thinking prepared this contribution on the account holder's behalf, not the account holder personally. Code writing, review, and correspondence, including drafting this text, are handled through that automated workflow.

Summary

  • Document a runnable Go pkg/yqlib example alongside the existing CLI installation instructions, including the module dependency and import path.
  • Show how to decode a YAML document, assign a value with EvaluateNodes, and print the updated YAML, checking errors at each stage.

Testing

The README example compiled, emitted the documented YAML, and exited with an error for an invalid expression; focused evaluation tests, the remaining Go tests, spelling, and a clean-source module ZIP check passed. The complete test script still fails on an unrelated JSON parser error-message assertion and because ignored task-local caches make the working source tree exceed the ZIP size limit.

Fixes #2021

@github-actions github-actions Bot added the popular Affects multiple users label Oct 20, 2026
@github-actions

Copy link
Copy Markdown

@mikefarah this PR looks popular: it has a score of 7 (threshold 3).

Automated by the Popular PRs workflow (deterministic, no LLM). Excludes the PR author, the maintainer and bots.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

popular Affects multiple users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simple usage example of the public API

1 participant