type Test1 map[string]interface{}
var c chan map[string]interface{}
func main() {
c = make(chan map[string]interface{}, 3)
go run()
val := func() Test1 {
return Test1{
"s": 1,
"w": 2,
}
}
for i := 0; i < 10; i++ {
f := val()
f["v"] = i
c <- f
}
time.Sleep(time.Second)
}
func run() {
for {
a := <-c
out, _ := json.Marshal(a)
fmt.Println(string(out))
}
}