goagi.*Error.Msg   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
package goagi
2
3
import "fmt"
4
5
// Error object for goagi library
6
type Error struct {
7
	s string
8
	e string
9
}
10
11
func newError(ctx string) *Error {
12
	return &Error{s: ctx}
13
}
14
15
// Msg append message to main context message
16
func (e *Error) Msg(msg string, args ...interface{}) error {
17
	e.e = fmt.Sprintf(msg, args...)
18
	return e
19
}
20
21
// Error message for the Error object
22
func (e *Error) Error() string {
23
	return fmt.Sprintf("%s: %s", e.s, e.e)
24
}
25