在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
// 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!
|
请发表评论