Add tells the progress meter that a single file of the given size will possibly be transferred. If a file doesn't need to be transferred for some reason, be sure to call Skip(int64) with the same size.
(size int64)
| 109 | // possibly be transferred. If a file doesn't need to be transferred for some |
| 110 | // reason, be sure to call Skip(int64) with the same size. |
| 111 | func (m *Meter) Add(size int64) { |
| 112 | if m == nil { |
| 113 | return |
| 114 | } |
| 115 | |
| 116 | defer m.update(false) |
| 117 | atomic.AddInt32(&m.estimatedFiles, 1) |
| 118 | atomic.AddInt64(&m.estimatedBytes, size) |
| 119 | } |
| 120 | |
| 121 | // Skip tells the progress meter that a file of size `size` is being skipped |
| 122 | // because the transfer is unnecessary. |
no test coverage detected