github.com/vanstinator/golangci-lint@v0.0.0-20240223191551-cc572f00d9d1/test/testdata/mirror.go (about)

     1  //golangcitest:args -Emirror
     2  package testdata
     3  
     4  import (
     5  	"strings"
     6  	"unicode/utf8"
     7  )
     8  
     9  func foobar() {
    10  	_ = utf8.RuneCount([]byte("foobar"))                                                                            // want `avoid allocations with utf8\.RuneCountInString`
    11  	_ = strings.Compare(string([]byte{'f', 'o', 'o', 'b', 'a', 'r'}), string([]byte{'f', 'o', 'o', 'b', 'a', 'r'})) // want `avoid allocations with bytes\.Compare`
    12  }