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

errof/errof.go   A

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 12
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A errof.Error.Error 0 2 1
A errof.New 0 4 1
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