Skip to content

Improve env binding, type support, and CI/docs alignment#2

Merged
spiegel-im-spiegel merged 5 commits into
masterfrom
devel
May 26, 2026
Merged

Improve env binding, type support, and CI/docs alignment#2
spiegel-im-spiegel merged 5 commits into
masterfrom
devel

Conversation

@spiegel-im-spiegel
Copy link
Copy Markdown
Member

Summary

This PR consolidates repository maintenance work and functional enhancements in struct2pflag.

  • Add environment-variable binding API:
    • BindEnv(v any, opts ...EnvOpt) error
    • options: WithEnvPrefix, WithEnvTag, WithStrict
    • sentinel errors compatible with errors.Is
  • Extend Bind to support additional types already supported by pflag:
    • float32, float64, time.Duration
  • Add/expand tests for env binding and new bindable types.
  • Add comments clarifying why time.Duration is handled in a dedicated path.
  • Align workflows and docs:
    • keep ci.yml + codeql.yml
    • remove legacy lint.yml
    • update README badges/sections and usage notes
    • add English env-bind specification doc
  • Update example behavior/documentation around JSON parsing warning handling.

Validation

  • go test -shuffle on ./...
  • golangci-lint-v2 run --enable gosec --timeout 3m0s ./...
  • task test

All checks pass locally.

Notes

  • Scope includes both maintenance alignment and feature additions that were developed incrementally on devel.

@github-advanced-security
Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@spiegel-im-spiegel spiegel-im-spiegel merged commit 8ef1c5a into master May 26, 2026
4 checks passed
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.

2 participants