mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Always use data as paramter name in UnmarshalJSON()
This commit is contained in:
parent
63b8d98237
commit
f3f07a29cc
3 changed files with 7 additions and 7 deletions
|
|
@ -13,15 +13,15 @@ import (
|
|||
type CommentType uint8
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (ct *CommentType) UnmarshalJSON(bytes []byte) error {
|
||||
func (ct *CommentType) UnmarshalJSON(data []byte) error {
|
||||
var i uint8
|
||||
if err := internal.UnmarshalJSON(bytes, &i); err != nil {
|
||||
if err := internal.UnmarshalJSON(data, &i); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c := CommentType(i)
|
||||
if _, ok := commentTypes[c]; !ok {
|
||||
return badCommentType(bytes)
|
||||
return badCommentType(data)
|
||||
}
|
||||
|
||||
*ct = c
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import (
|
|||
type NotificationStates uint8
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (nst *NotificationStates) UnmarshalJSON(bytes []byte) error {
|
||||
func (nst *NotificationStates) UnmarshalJSON(data []byte) error {
|
||||
var states []string
|
||||
if err := internal.UnmarshalJSON(bytes, &states); err != nil {
|
||||
if err := internal.UnmarshalJSON(data, &states); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import (
|
|||
type NotificationTypes uint16
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (nt *NotificationTypes) UnmarshalJSON(bytes []byte) error {
|
||||
func (nt *NotificationTypes) UnmarshalJSON(data []byte) error {
|
||||
var types []string
|
||||
if err := internal.UnmarshalJSON(bytes, &types); err != nil {
|
||||
if err := internal.UnmarshalJSON(data, &types); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue