mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-30 08:38:41 +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.
22 lines
380 B
Go
22 lines
380 B
Go
package main
|
|
|
|
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'))
|
|
}
|