Passed
Push — master ( 53aaea...98fee7 )
by kota
06:18
created

errof.Error.Error   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
nop 0
1
package errof
2
3
// ErrorCode is vuls error code
4
type ErrorCode string
5
6
// Error is vuls error
7
type Error struct {
8
	Code    ErrorCode
9
	Message string
10
}
11
12
func (e Error) Error() string {
13
	return e.Message
14
}
15
16
var (
17
	// ErrFailedToAccessGithubAPI is error of github alert's api access
18
	ErrFailedToAccessGithubAPI ErrorCode = "ErrFailedToAccessGithubAPI"
19
)
20
21
// New :
22
func New(code ErrorCode, msg string) Error {
23
	return Error{
24
		Code:    code,
25
		Message: msg,
26
	}
27
}
28