(inner UpdateProgress, start, end float64)
| 55 | type UpdateProgress func(percentage float64) |
| 56 | |
| 57 | func UpdateProgressWithRange(inner UpdateProgress, start, end float64) UpdateProgress { |
| 58 | return func(p float64) { |
| 59 | if p < 0 { |
| 60 | p = 0 |
| 61 | } |
| 62 | if p > 100 { |
| 63 | p = 100 |
| 64 | } |
| 65 | scaled := start + (end-start)*(p/100.0) |
| 66 | inner(scaled) |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | type URL interface { |
| 71 | URL() string |
no outgoing calls
no test coverage detected