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
Pull Request — master (#170)
by Victor Hugo
02:26 queued 11s
created

mollie/errors.go   A

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
cc 2
eloc 15
dl 0
loc 29
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mollie.*BaseError.Error 0 8 2
1
package mollie
2
3
import "fmt"
4
5
// ErrorLinks container references to common urls
6
// returned with errors.
7
type ErrorLinks struct {
8
	Documentation *URL `json:"documentation,omitempty"`
9
}
10
11
// BaseError contains the general error structure
12
// returned by mollie.
13
type BaseError struct {
14
	Status int         `json:"status,omitempty"`
15
	Title  string      `json:"title,omitempty"`
16
	Detail string      `json:"detail,omitempty"`
17
	Field  string      `json:"field,omitempty"`
18
	Links  *ErrorLinks `json:"_links,omitempty"`
19
}
20
21
// Error interface compliance.
22
func (be *BaseError) Error() string {
23 1
	str := fmt.Sprintf("%d %s: %s", be.Status, be.Title, be.Detail)
24
25 1
	if len(be.Field) > 0 {
26 1
		str = fmt.Sprintf("%s, affected field: %s", str, be.Field)
27
	}
28
29 1
	return str
30
}
31