Oleg Butuzov 9f2528a30c
Some checks failed
Release a tag / release (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/Dockerfile]) (push) Has been cancelled
Release a tag / docker-release (map[Dockerfile:build/alpine.Dockerfile]) (push) Has been cancelled
mirror: linter that suggest using alternative string/[]byte functions (#3825)
2023-06-01 14:16:39 +02:00

13 lines
435 B
Go

//golangcitest:args -Emirror
package testdata
import (
"strings"
"unicode/utf8"
)
func foobar() {
_ = utf8.RuneCount([]byte("foobar")) // want `avoid allocations with utf8\.RuneCountInString`
_ = strings.Compare(string([]byte{'f', 'o', 'o', 'b', 'a', 'r'}), string([]byte{'f', 'o', 'o', 'b', 'a', 'r'})) // want `avoid allocations with bytes\.Compare`
}