标签:
===============golang pipe============== package main import ( "fmt" "io" ) func main() { reader, writer := io.Pipe() inputData := []byte("1234567890ABCD") go writer.Write(inputData) outputData := make([]byte, 11) n, _ := reader.Read(outputData) fmt.Println(string(outputData)) fmt.Println("read number", n) fmt.Println(string(outputData)) } /* 1234567890A read number 11 1234567890A */
标签:
原文地址:http://www.cnblogs.com/rojas/p/4396031.html