go helloworld

// Sample program to show how a bytes.Buffer can also be used
// with the io.Copy function.
package main import (
"bytes"
"fmt"
"io"
"os"
) // main is the entry point for the application.
func main() {
var b bytes.Buffer // Write a string to the buffer.
b.Write([]byte("Hello")) // Use Fprintf to concatenate a string to the Buffer.
fmt.Fprintf(&b, " World!\n") // Write the content of the Buffer to stdout.
io.Copy(os.Stdout, &b)
}

输出

Hello World!
上一篇:编程菜鸟的日记-初学尝试编程-C++ Primer Plus 第5章编程练习5


下一篇:SpringCloud的部署模型