package main
import (
"fmt"
"io"
"os"
)
func main() {
// Simply write string
io.WriteString(os.Stdout,
"This is string to standard output.
")
io.WriteString(os.Stderr,
"This is string to standard error output.
")
// Stdout/err implements
// writer interface
buf := []byte{0xAF, 0xFF, 0xFE}
for i := 0; i < 20; i++ {
if _, e := os.Stdout.Write(buf); e != nil {
panic(e)
}
}
// The fmt package
// could be used too
fmt.Fprintln(os.Stdout, "
")
}
/*
This is string to standard error output.
This is string to standard output.
������������������������������������������������������������
*/