feat(reflection): add ExtractTagValue and GetRelationshipInfo functions

* Implement ExtractTagValue to handle struct tag parsing.
* Introduce GetRelationshipInfo for extracting relationship metadata.
* Update tests to validate new functionality.
* Refactor related code for improved clarity and maintainability.
This commit is contained in:
Hein
2026-01-07 11:54:12 +02:00
parent e220ab3d34
commit bf7125efc3
8 changed files with 437 additions and 273 deletions

View File

@@ -269,8 +269,6 @@ func TestToSnakeCase(t *testing.T) {
}
func TestExtractTagValue(t *testing.T) {
handler := NewHandler(nil, nil)
tests := []struct {
name string
tag string
@@ -311,9 +309,9 @@ func TestExtractTagValue(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := handler.extractTagValue(tt.tag, tt.key)
result := common.ExtractTagValue(tt.tag, tt.key)
if result != tt.expected {
t.Errorf("extractTagValue(%q, %q) = %q, expected %q", tt.tag, tt.key, result, tt.expected)
t.Errorf("ExtractTagValue(%q, %q) = %q, expected %q", tt.tag, tt.key, result, tt.expected)
}
})
}