minor: destructure res
Vladimir Bauer
3 years ago
| 143 | 143 | ch <- result{bar, bs} |
| 144 | 144 | }: |
| 145 | 145 | res := <-ch |
| 146 | res.bar.TraverseDecorators(func(d decor.Decorator) { | |
| 146 | bar, bs := res.bar, res.bs | |
| 147 | bar.TraverseDecorators(func(d decor.Decorator) { | |
| 147 | 148 | if d, ok := d.(decor.AverageDecorator); ok { |
| 148 | res.bs.averageDecorators = append(res.bs.averageDecorators, d) | |
| 149 | bs.averageDecorators = append(bs.averageDecorators, d) | |
| 149 | 150 | } |
| 150 | 151 | if d, ok := d.(decor.EwmaDecorator); ok { |
| 151 | res.bs.ewmaDecorators = append(res.bs.ewmaDecorators, d) | |
| 152 | bs.ewmaDecorators = append(bs.ewmaDecorators, d) | |
| 152 | 153 | } |
| 153 | 154 | if d, ok := d.(decor.ShutdownListener); ok { |
| 154 | res.bs.shutdownListeners = append(res.bs.shutdownListeners, d) | |
| 155 | bs.shutdownListeners = append(bs.shutdownListeners, d) | |
| 155 | 156 | } |
| 156 | 157 | }) |
| 157 | return res.bar | |
| 158 | return bar | |
| 158 | 159 | case <-p.done: |
| 159 | 160 | panic(DoneError) |
| 160 | 161 | } |