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

NoticeHandler.go   A

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 11
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A main.*NoticeHandler.execute 0 4 2
A main.*NoticeHandler.setNext 0 2 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
// NoticeHandler is ...
11
type NoticeHandler struct {
12
	name string
13
	next HandlerInterface
14
}
15
16
func (N *NoticeHandler) execute() {
17
	fmt.Println(N.name)
18
	if N.next != nil {
19
		N.next.execute()
20
	}
21
}
22
23
func (N *NoticeHandler) setNext(next HandlerInterface) {
24
	N.next = next
25
}
26