From e73e25b624c37a936bb42f50a11f56297a4cd637 Mon Sep 17 00:00:00 2001 From: apocelipes Date: Wed, 25 Oct 2023 10:29:01 +0000 Subject: [PATCH] internal/cpu: add comments to copied functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Martin Möhrmann TryBot-Result: Gopher Robot Run-TryBot: Martin Möhrmann Reviewed-by: Keith Randall --- src/internal/cpu/cpu.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/internal/cpu/cpu.go b/src/internal/cpu/cpu.go index b6cbf2f661..91b5b9b91f 100644 --- a/src/internal/cpu/cpu.go +++ b/src/internal/cpu/cpu.go @@ -213,6 +213,8 @@ field: // 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 { -- 2.50.0