package main import ( "fmt" "sync" ) type ChannelItem struct { tag string upBytes uint64 downBytes uint64 } type DurationChannelItems struct { durationTag string channelItemMap map[string]ChannelItem } var durationChannelItemsMap = map[string]DurationChannelItems{} var durationChannelItemsMapLock = sync.RWMutex{} type CountItem struct { tag string timestamp uint64 upBytes uint64 downBytes uint64 } var countItemChan = make(chan CountItem) // var countItemChan = make(ChannelItem, 0) func main() { } func collectCountItem() { for { countItem := <-countItemChan // TODO ... fmt.Printf("%v\n", countItem) } }