mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 18:47:47 +00:00
f2cd4d12e8
strings.IndexByte was implemented in the runtime up to Go 1.11. It is implemented using a direct call to internal/bytealg.IndexByte since Go 1.12. Make sure we remain compatible with both.
13 lines
352 B
Go
13 lines
352 B
Go
// +build !go1.12
|
|
|
|
package runtime
|
|
|
|
// indexByte provides compatibility with Go 1.11.
|
|
// See the following:
|
|
// https://github.com/tinygo-org/tinygo/issues/351
|
|
// https://github.com/golang/go/commit/ad4a58e31501bce5de2aad90a620eaecdc1eecb8
|
|
//go:linkname indexByte strings.IndexByte
|
|
func indexByte(s string, c byte) int {
|
|
return indexByteString(s, c)
|
|
}
|