github.com/nozzle/golangci-lint@v1.49.0-nz3/test/testdata/gosimple.go (about)

     1  //golangcitest:args -Egosimple
     2  package testdata
     3  
     4  import (
     5  	"log"
     6  )
     7  
     8  func Gosimple(ss []string) {
     9  	if ss != nil { // want "S1031: unnecessary nil check around range"
    10  		for _, s := range ss {
    11  			log.Printf(s)
    12  		}
    13  	}
    14  }
    15  
    16  func GosimpleNolintGosimple(ss []string) {
    17  	if ss != nil { //nolint:gosimple
    18  		for _, s := range ss {
    19  			log.Printf(s)
    20  		}
    21  	}
    22  }
    23  
    24  func GosimpleNolintMegacheck(ss []string) {
    25  	if ss != nil { //nolint:megacheck
    26  		for _, s := range ss {
    27  			log.Printf(s)
    28  		}
    29  	}
    30  }