Passed
Pull Request — master (#5)
by Korotkov
01:34
created

main.*ErrorHandler.setNext   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 1
1
/**
2
 * @author  : Jagepard <[email protected]>
3
 * @license https://mit-license.org/ MIT
4
 */
5
6
package main
7
8
import "fmt"
9
10
// ErrorHandler is ...
11
type ErrorHandler struct {
12
	name string
13
	next HandlerInterface
14
}
15
16
func (E *ErrorHandler) execute() {
17
	fmt.Println(E.name)
18
	if E.next != nil {
19
		E.next.execute()
20
	}
21
}
22
23
func (E *ErrorHandler) setNext(next HandlerInterface) {
24
	E.next = next
25
}
26