Unverified Commit 7bcfc037 authored by Sander van Harmelen's avatar Sander van Harmelen Committed by GitHub

Fix the custom `UnmarshalJSON` function (#311)

parent e8a1b36a
...@@ -129,6 +129,8 @@ func (l *NotificationLevelValue) UnmarshalJSON(data []byte) error { ...@@ -129,6 +129,8 @@ func (l *NotificationLevelValue) UnmarshalJSON(data []byte) error {
*l = NotificationLevelValue(raw) *l = NotificationLevelValue(raw)
case string: case string:
*l = notificationLevelTypes[raw] *l = notificationLevelTypes[raw]
case nil:
// No action needed.
default: default:
return fmt.Errorf("json: cannot unmarshal %T into Go value of type %T", raw, *l) return fmt.Errorf("json: cannot unmarshal %T into Go value of type %T", raw, *l)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment