Skip to content

Rewrite the package docs and add runnable examples - #10

Merged
rjp2525 merged 1 commit into
mainfrom
godoc
Nov 17, 2026
Merged

rjp2525 merged 1 commit into
mainfrom
godoc

Conversation

@rjp2525

@rjp2525 rjp2525 commented Nov 17, 2026

Copy link
Copy Markdown
Owner

The godoc is the first thing most people read on pkg.go.dev. It still described the package as it was before this round of work.

  • doc.go is rewritten. It opens with what the package is for, then walks through handlers, the Fields loop, steering a walk, middleware and concurrency, with links to the symbols.
  • Every field of FieldContext has a comment saying what it holds, including what a path looks like for slices and maps.
  • context.go is renamed to field.go. It holds FieldContext, and now that the package also deals in context.Context the old name pointed the wrong way.
  • New examples that run as tests: FieldContext.SetValue (defaults into an int, a duration, a time and a pointer), FieldContext.Lookup, Walker.WalkContext and Tag.
  • The old cycle test only checked that the walk made fewer than ten visits. The traversal tests assert the exact paths, so it is removed.

Release notes

Documentation only.

@rjp2525
rjp2525 merged commit e3fb72f into main Nov 17, 2026
5 checks passed
@rjp2525
rjp2525 deleted the godoc branch November 17, 2026 21:55
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