-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export convertors #51
Comments
It's an implementation detail, so best not to export it. Does |
I don't think RegisterConverter helps. Decode errors out[0] if the value provided is not struct, isn't it? An alternative would be to provide a new function DecodeValue(valStr string, kind reflect.Kind)reflect.Value which decodes a single value. [0] https://github.com/gorilla/schema/blob/master/decoder.go#L72 |
Hm maybe I'm not clear on what you are looking for. You want to decode the values in to a map directly, one which isn't a member of a struct? I'm not sure why you would even need the schema package for that. |
I need to unmarshal a map[string][]string into two variables . One is a struct and the other is of a type supported by schema (bool, int etc) but unknown at compile time. So I use schema.Decoder to unmarshal the map into the struct and then I need to parse the value of the 2nd variable(I know its key) thus the reason why I need the Convertors/parsing function.
|
Shortly said schema package has an internal function(convertors) which marshals a string into various types/kinds and I need just that thus the proposal to export it. |
This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days. |
Is there any reason not to export
convertors
? I need to decode a payload which is composed either by structs or /and non-struct types (e.g. map[string]float64). Currently the decoder errors out if the destination is not a struct so I've forked the repo and just exported convertors.The text was updated successfully, but these errors were encountered: