receiver name s should be consistent with previous receiver name d
Vladimir Bauer
7 years ago
| 191 | 191 | return d.FormatMsg(d.msg) |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | func (s *movingAverageSpeed) NextAmount(n int, wdd ...time.Duration) { | |
| 194 | func (d *movingAverageSpeed) NextAmount(n int, wdd ...time.Duration) { | |
| 195 | 195 | var workDuration time.Duration |
| 196 | 196 | for _, wd := range wdd { |
| 197 | 197 | workDuration = wd |
| 200 | 200 | if math.IsInf(speed, 0) || math.IsNaN(speed) { |
| 201 | 201 | return |
| 202 | 202 | } |
| 203 | s.average.Add(speed) | |
| 203 | d.average.Add(speed) | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | func (d *movingAverageSpeed) OnCompleteMessage(msg string) { |