GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( ade00f...013a6a )
by
unknown
01:57 queued 14s
created

mollie/custom_types.go   A

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 13
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mollie.*ContextValues.UnmarshalJSON 0 16 3
1
package mollie
2
3
import (
4
	"encoding/json"
5
)
6
7
// ContextValues is a map of TransactionType to ContextValue.
8
type ContextValues map[TransactionType]ContextValue
9
10
// UnmarshalJSON implements the json.Unmarshaler interface on ContextValues.
11
//
12
// See: https://github.com/VictorAvelar/mollie-api-go/issues/251
13
func (cv *ContextValues) UnmarshalJSON(data []byte) error {
14
	var d map[TransactionType]ContextValue
15
16
	if err := json.Unmarshal(data, &d); err != nil {
17
		if _, ok := err.(*json.UnmarshalTypeError); ok {
18
			*cv = make(ContextValues)
19
20
			return nil
21
		}
22
23
		return err
24
	}
25
26
	*cv = ContextValues(d)
27
28
	return nil
29
}
30