Passed
Push — master ( 0347a5...cbb462 )
by Korotkov
02:24 queued 01:31
created

main.*WarningHandler.execute   A

Complexity

Conditions 2

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
nop 0
1
/**
2
 * @author  : Jagepard <[email protected]>
3
 * @license https://mit-license.org/ MIT
4
 */
5
6
package main
7
8
import "fmt"
9
10
// WarningHandler is ...
11
type WarningHandler struct {
12
	name string
13
	next HandlerInterface
14
}
15
16
func (W *WarningHandler) execute() {
17
	fmt.Println(W.name)
18
	if W.next != nil {
19
		W.next.execute()
20
	}
21
}
22
23
func (W *WarningHandler) setNext(next HandlerInterface) {
24
	W.next = next
25
}
26