github.com/ernado/golangci-lint@v1.10.1/test/testdata/dupl.go (about)

     1  // args: -Edupl --dupl.threshold=20
     2  package testdata
     3  
     4  type DuplLogger struct{}
     5  
     6  func (DuplLogger) level() int {
     7  	return 1
     8  }
     9  
    10  func (DuplLogger) Debug(args ...interface{}) {}
    11  func (DuplLogger) Info(args ...interface{})  {}
    12  
    13  func (logger *DuplLogger) First(args ...interface{}) { // ERROR "13-22 lines are duplicate of `testdata/dupl.go:24-33`"
    14  	if logger.level() >= 0 {
    15  		logger.Debug(args...)
    16  		logger.Debug(args...)
    17  		logger.Debug(args...)
    18  		logger.Debug(args...)
    19  		logger.Debug(args...)
    20  		logger.Debug(args...)
    21  	}
    22  }
    23  
    24  func (logger *DuplLogger) Second(args ...interface{}) { // ERROR "24-33 lines are duplicate of `testdata/dupl.go:13-22`"
    25  	if logger.level() >= 1 {
    26  		logger.Info(args...)
    27  		logger.Info(args...)
    28  		logger.Info(args...)
    29  		logger.Info(args...)
    30  		logger.Info(args...)
    31  		logger.Info(args...)
    32  	}
    33  }