Test Failed
Push — master ( d4cdd3...569253 )
by Vyacheslav
03:17 queued 01:50
created

error.go   A

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 12
dl 0
loc 20
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A goagi.newError 0 2 1
A goagi.*Error.Msg 0 3 1
A goagi.*Error.Error 0 2 1
1
package goagi
2
3
import "fmt"
4
5
type Error struct {
0 ignored issues
show
introduced by
exported type Error should have comment or be unexported
Loading history...
6
	s string
7
	e string
8
}
9
10
func newError(ctx string) *Error {
11
	return &Error{s: ctx}
12
}
13
14
func (e *Error) Msg(msg string, args ...interface{}) error {
0 ignored issues
show
introduced by
exported method Error.Msg should have comment or be unexported
Loading history...
15
	e.e = fmt.Sprintf(msg, args...)
0 ignored issues
show
introduced by
can't check non-constant format in call to Sprintf
Loading history...
16
	return e
17
}
18
19
func (e *Error) Error() string {
20
	return fmt.Sprintf("%s: %s", e.s, e.e)
21
}
22