diff options
author | Ayke van Laethem <[email protected]> | 2019-05-24 14:35:17 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-05-24 14:51:40 +0200 |
commit | f2cd4d12e883761435b8b2059475443162865d21 (patch) | |
tree | c02aa0d5079da779034ead8fe20cab5645c30711 /testdata | |
parent | 7e6a54ac620e45481793807437c0f915cb6b85d1 (diff) | |
download | tinygo-f2cd4d12e883761435b8b2059475443162865d21.tar.gz tinygo-f2cd4d12e883761435b8b2059475443162865d21.zip |
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.
Diffstat (limited to 'testdata')
-rw-r--r-- | testdata/stdlib.go | 6 | ||||
-rw-r--r-- | testdata/stdlib.txt | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/testdata/stdlib.go b/testdata/stdlib.go index 2996cdb29..a06a6cbf2 100644 --- a/testdata/stdlib.go +++ b/testdata/stdlib.go @@ -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')) } diff --git a/testdata/stdlib.txt b/testdata/stdlib.txt index 27f48238b..aeef0388d 100644 --- a/testdata/stdlib.txt +++ b/testdata/stdlib.txt @@ -2,3 +2,4 @@ stdin: 0 stdout: 1 stderr: 2 pseudorandom number: 1298498081 +strings.IndexByte: 2 |