Skip to content

Conversation

@hnimtadd
Copy link

No description provided.

@coveralls
Copy link

coveralls commented Dec 15, 2024

Coverage Status

coverage: 95.019% (+0.4%) from 94.66%
when pulling b1cd38c on hnimtadd:enhance-default-tag
into 4214131 on go-playground:master.

@hnimtadd hnimtadd force-pushed the enhance-default-tag branch from fab3464 to f68af3e Compare December 15, 2024 14:38
@hnimtadd hnimtadd force-pushed the enhance-default-tag branch from f68af3e to b1cd38c Compare December 15, 2024 14:52
// 2. Attempting to set its underlying value
// Try to convert the parameter string to the appropriate primitive type
// that the pointer references (e.g., *string, *int, *bool)
value, err := mold.GetPrimitiveValue(fl.Field().Type().Elem().Kind(), fl.Param())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the new GetPrimitiveValue function could we change the function signature of setValue to accept reflect.Value and string(the param) and recursively call it dereferencing the pointer.

This would avoid needing the new function I think and addition of the new error types as well.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some time to do and test this today #49

everything should be working as expected as of Release 4.5.1 https://github.com/go-playground/mold/releases/tag/v4.5.1

@deankarn
Copy link

I very much appreciate the PR it helped visualize the issue and by providing relevant tests :)

Closing as #49 resolved this is a slightly different way and is now part of release https://github.com/go-playground/mold/releases/tag/v4.5.1

@deankarn deankarn closed this Dec 29, 2024
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.

3 participants