Just as same as other copied functions,
like stringsTrimSuffix in "os/executable_procfs.go"
Change-Id: I9c9fbd75b009a5ae0e869cf1fddc77c0e08d9a67
GitHub-Last-Rev:
4c18865e15ede0f53121b6845a1879cdd70d1a38
GitHub-Pull-Request: golang/go#63704
Reviewed-on: https://go-review.googlesource.com/c/go/+/537056
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
// indexByte returns the index of the first instance of c in s,
// or -1 if c is not present in s.
+// indexByte is semantically the same as [strings.IndexByte].
+// We copy this function because "internal/cpu" should not have external dependencies.
func indexByte(s string, c byte) int {
for i := 0; i < len(s); i++ {
if s[i] == c {