We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11cde5c commit dcb8be0Copy full SHA for dcb8be0
1 file changed
internal/commands/storage/import.go
@@ -39,18 +39,18 @@ func ImportCommand() commands.Command {
39
40
type readerCounter struct {
41
source io.Reader
42
- read int64
+ read atomic.Int64
43
}
44
45
// Read implements io.Reader
46
func (s *readerCounter) Read(p []byte) (n int, err error) {
47
n, err = s.source.Read(p)
48
- atomic.AddInt64(&s.read, int64(n))
+ s.read.Add(int64(n))
49
return n, err
50
51
52
func (s *readerCounter) counter() int {
53
- return int(atomic.LoadInt64(&s.read))
+ return int(s.read.Load())
54
55
56
type importCommand struct {
0 commit comments