Skip to content

fix: Key normalization inconsistency#2

Merged
Azhovan merged 1 commit into
masterfrom
jabar/fix-stric-mode-binding-behavior
Nov 30, 2025
Merged

fix: Key normalization inconsistency#2
Azhovan merged 1 commit into
masterfrom
jabar/fix-stric-mode-binding-behavior

Conversation

@Azhovan

@Azhovan Azhovan commented Nov 30, 2025

Copy link
Copy Markdown
Owner

What

This PR fixes a bug in which inconsistent key normalization caused binding failures:

Before:

Source keys: Fully lowercased (strings.ToLower(key))
Field keys: Only first letter lowercased (APIKeyaPIKey)
Result: Keys didn't match! apikeyaPIKey

Why

  • Multi-word field names (APIKey, MaxConnections) wouldn't bind correctly
  • Uppercase in prefix: and name: tags wouldn't match normalized source keys
  • Strict mode would incorrectly report unknown keys

Type

  • Fix
  • Feature
  • Docs
  • Performance
  • Breaking change

Testing

  • TestBindStruct_MultiWordFields: Tests APIKey, MaxConnections, RetryTimeout
  • TestBindStruct_PrefixNormalization: Tests uppercase prefix tags
  • TestBindStruct_CustomNameNormalization: Tests uppercase name tags
  • TestDeriveFieldKey: Unit tests for key derivation function
# Commands you ran
go test ./...

Checklist

  • Tests pass (go test ./...)
  • Formatted (gofmt -s -w .)
  • No vet warnings (go vet ./...)
  • Coverage maintained (>70%)
  • Added tests if needed
  • Updated docs if needed

For reviewers: Does this align with Rigging's philosophy of simplicity and zero dependencies?

@Azhovan Azhovan self-assigned this Nov 30, 2025
@Azhovan Azhovan changed the title fix multi field normalization binding issue fix: Key normalization inconsistency Nov 30, 2025
@Azhovan Azhovan merged commit f8fe635 into master Nov 30, 2025
5 checks passed
@Azhovan Azhovan deleted the jabar/fix-stric-mode-binding-behavior branch November 30, 2025 14:11
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