-
Notifications
You must be signed in to change notification settings - Fork 77
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
Bugs when properties are specified as metadata of struct #32
Comments
Fields with |
When I try this specific example Decode returns an error. Do you check all the errors? Added this to func TestDecodeSkipFail(t *testing.T) {
type S struct {
V sarama.KafkaVersion `properties:"kafka.version,default=0.11.0.2"`
S string
}
in := `S=some value`
out := &S{sarama.V0_11_0_2, "some value"}
testDecode(t, in, &S{}, out)
}
|
yes. I had missed checking the error. |
This should be in the godoc or isn’t it? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are some bugs when we specify properties as part of the struct metadata.
e.g
config file
It fails on the first field/property it has a issue within the struct. All fields after this filed (in struct order) are not processed. e.g if the field KafkaVersion could not be decoded then all fields below it will also not be decoded.
There are issues in following cases
1> The property is missing in property file and no default value is mentioned in the struct
2> if the field type is not supported by decoder eg (sarama.KafkaVersion)
3> if the fields in the struct do not have the property tag and a property with the field name is not present in the property file.
Is there any way we can exclude a field from decode logic?
Regards
Rohan
The text was updated successfully, but these errors were encountered: