From eb9c2c276e76cbc9c5876bb5e385117aeffa1ce3 Mon Sep 17 00:00:00 2001 From: BCG Date: Thu, 23 Jan 2020 00:06:34 -0500 Subject: [PATCH] Added indexBytePortal from standard library to link as implementation for internal/bytealg.IndexByte --- src/runtime/bytes.go | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/runtime/bytes.go diff --git a/src/runtime/bytes.go b/src/runtime/bytes.go new file mode 100644 index 000000000..6b3d6be73 --- /dev/null +++ b/src/runtime/bytes.go @@ -0,0 +1,11 @@ +package runtime + +//go:linkname indexBytePortable internal/bytealg.IndexByte +func indexBytePortable(s []byte, c byte) int { + for i, b := range s { + if b == c { + return i + } + } + return -1 +}