Skip to content
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

lib/events: Fix unmarshaling of EventType #4540

Closed
wants to merge 1 commit into from
Closed

lib/events: Fix unmarshaling of EventType #4540

wants to merge 1 commit into from

Conversation

monstermunchkin
Copy link
Contributor

Purpose

This allows to properly unmarshal an Event. Prior to this change, unmarshaling would have failed with:

json: cannot unmarshal string into Go struct field Event.type of type events.EventType

Testing

A Test has been added which tries unmarshaling an Event.

@AudriusButkevicius
Copy link
Member

When is it actually unmarshalled?

@monstermunchkin
Copy link
Contributor Author

Not in syncthing directly, but when you want to unmarshal a JSON object from the REST API into an events.Event struct. If this is not handled here, you would have to redefine the Event struct in your own code which is more work than actually needed.

@AudriusButkevicius
Copy link
Member

@st-review merge

lib/events: Fix unmarshaling of EventType

skip-check: authors

@st-review
Copy link

👌 Merged as b2af8f1. Thanks, @monstermunchkin!

@st-review st-review closed this Nov 22, 2017
st-review pushed a commit that referenced this pull request Nov 22, 2017
skip-check: authors

GitHub-Pull-Request: #4540
@st-review st-review added the pr-merged Legacy label used in the past for pull requests merged to the main tree label Jan 15, 2018
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Nov 23, 2018
@syncthing syncthing locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion pr-merged Legacy label used in the past for pull requests merged to the main tree
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants