Closed xose closed 6 years ago
Thanks for the contribution! Could you add one or two tests for this scenario?
Yes, I'll write some tests. But I've been thinking that simply ignoring the field when it has the wrong type may not be the best overall solution. It works for my use case but returning an error could be a better approach for the library.
Thoughts? Should I rewrite the PR to return an error instead?
@xose yeah you are right, we return an error anyways when the unmarshalling fails so we could also inform the caller that a type mismatch is happening. So a return err
would be great.
Sending a GELF message with the wrong type for any of the common fields will result in a panic.
This PR adds type assertion so any fields received with the wrong type will just be ignored.