mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
6bcb40fe01
This allows applications to mount filesystems in the os package. This is useful for mounting external flash filesystems, for example.
23 lines
471 B
Go
23 lines
471 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"math/rand"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func main() {
|
|
// package os, fmt
|
|
fmt.Println("stdin: ", os.Stdin.Name())
|
|
fmt.Println("stdout:", os.Stdout.Name())
|
|
fmt.Println("stderr:", os.Stderr.Name())
|
|
|
|
// package math/rand
|
|
fmt.Println("pseudorandom number:", rand.Int31())
|
|
|
|
// package strings
|
|
fmt.Println("strings.IndexByte:", strings.IndexByte("asdf", 'd'))
|
|
fmt.Println("strings.Replace:", strings.Replace("An example string", " ", "-", -1))
|
|
}
|