我需要在一段时间内(比如5秒)从Gochannel读取数据。带超时的select语句对我不起作用,因为我需要读取尽可能多的可用值并在5秒后准确停止。到目前为止,我已经想出了一个使用额外时间channel的解决方案https://play.golang.org/p/yev9CcvzRILpackagemainimport"time"import"fmt"funcmain(){//IhavenocontroloverdataChandataChan:=make(chanstring)//thisisastubtodemonstratesomedatacomingfromdataChango