mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 20:13:40 +00:00
compiler,runtime: fix multiple definitions of a single function
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.
This commit is contained in:
committed by
Ron Evans
parent
7e6a54ac62
commit
f2cd4d12e8
Vendored
+6
@@ -4,12 +4,18 @@ import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// package os, fmt
|
||||
fmt.Println("stdin: ", os.Stdin.Fd())
|
||||
fmt.Println("stdout:", os.Stdout.Fd())
|
||||
fmt.Println("stderr:", os.Stderr.Fd())
|
||||
|
||||
// package math/rand
|
||||
fmt.Println("pseudorandom number:", rand.Int31())
|
||||
|
||||
// package strings
|
||||
fmt.Println("strings.IndexByte:", strings.IndexByte("asdf", 'd'))
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -2,3 +2,4 @@ stdin: 0
|
||||
stdout: 1
|
||||
stderr: 2
|
||||
pseudorandom number: 1298498081
|
||||
strings.IndexByte: 2
|
||||
|
||||
Reference in New Issue
Block a user