Skip to content

docs: explain env prefixing for nested structs#46

Merged
rlball merged 1 commit into
mainfrom
rball-cursor/document-nested-struct-env-prefix
Jun 18, 2026
Merged

docs: explain env prefixing for nested structs#46
rlball merged 1 commit into
mainfrom
rball-cursor/document-nested-struct-env-prefix

Conversation

@rlball

@rlball rlball commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a "Nested structs and env prefixes" section to the README explaining that a parent struct field name is automatically prepended as a prefix to nested config keys.
  • Clarifies that nested env tags should contain only their leaf name (e.g. env:"ENDPOINT"S3_ENDPOINT).
  • Documents the S3_S3_ENDPOINT gotcha from the issue, plus how to override the prefix via an env tag on the parent field and how to drop it with omitprefix.

Behavior was verified against load/env/env.go; this is a docs-only change since the existing behavior is intentional and just wasn't documented.

Closes #38.

Test plan

  • Render the README and confirm the new section reads correctly and the examples are accurate.

Clarify that a parent struct field name is automatically prepended as a
prefix to nested keys, so nested env tags should use only the leaf name.
Documents the S3_S3_ENDPOINT gotcha and how to override or omit the
prefix. Closes #38.
@rlball
rlball merged commit 63fbf71 into main Jun 18, 2026
3 checks passed
@rlball
rlball deleted the rball-cursor/document-nested-struct-env-prefix branch June 18, 2026 17:41
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.

Document how the env tag works when using structs-in-structs

1 participant