for {
select {
case <-n.ctx.Done():
return
case ts := <-tsets:
n.reload(ts)
default:
select {
case <-n.ctx.Done():
return
case ts := <-tsets:
n.reload(ts)
case <-n.more:
}
}
}
the code above is in https://github.com/prometheus/prometheus/blob/main/notifier/notifier.go Function Run(tsets <-chan map[string][]*targetgroup.Group). Why default write select again, Dose it has any difference with the following code
for {
select {
case <-n.ctx.Done():
return
case ts := <-tsets:
n.reload(ts)
case <-n.more:
}
}
I want to know the difference between these two implementation methods and their impact. thank u