Good afternoon, I apologize for such a perhaps simple question, but this is the first time I encounter such a task, I receive data from two channels, how to properly write them into one structure?
type valChannels struct {
valueCh1 type
valueCh2 type
}
go func() {
for vCh1 := channel1 {
fmt.Println(vCh1)
}
}()
go func() {
for vCh2 := channel2 {
fmt.Println(vCh2)
}
}()
How can I write the values I get from the channels into one structure so that I can output
fmt.Println(&valChannels{
vCh1,
vCh2,
})