forked from golangci/golangci-lint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdupl.go
34 lines (29 loc) · 842 Bytes
/
dupl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//golangcitest:args -Edupl
//golangcitest:config linters-settings.dupl.threshold=20
package testdata
type DuplLogger struct{}
func (DuplLogger) level() int {
return 1
}
func (DuplLogger) Debug(args ...interface{}) {}
func (DuplLogger) Info(args ...interface{}) {}
func (logger *DuplLogger) First(args ...interface{}) { // ERROR "14-23 lines are duplicate of `.*dupl.go:25-34`"
if logger.level() >= 0 {
logger.Debug(args...)
logger.Debug(args...)
logger.Debug(args...)
logger.Debug(args...)
logger.Debug(args...)
logger.Debug(args...)
}
}
func (logger *DuplLogger) Second(args ...interface{}) { // ERROR "25-34 lines are duplicate of `.*dupl.go:14-23`"
if logger.level() >= 1 {
logger.Info(args...)
logger.Info(args...)
logger.Info(args...)
logger.Info(args...)
logger.Info(args...)
logger.Info(args...)
}
}