Skip to content

Commit 7addf09

Browse files
committed
Reorder bodyReader fields to separate constants and state
Purely aesthetic, should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
1 parent ab3f42c commit 7addf09

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docker/body_reader.go

+15-15
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ const bodyReaderMinimumProgress = 1 * 1024 * 1024
2323
// bodyReader is an io.ReadCloser returned by dockerImageSource.GetBlob,
2424
// which can transparently resume some (very limited) kinds of aborted connections.
2525
type bodyReader struct {
26-
ctx context.Context
27-
c *dockerClient
28-
29-
path string // path to pass to makeRequest to retry
30-
logURL *url.URL // a string to use in error messages
31-
body io.ReadCloser // The currently open connection we use to read data, or nil if there is nothing to read from / close.
32-
lastRetryOffset int64
33-
offset int64 // Current offset within the blob
26+
ctx context.Context
27+
c *dockerClient
28+
path string // path to pass to makeRequest to retry
29+
logURL *url.URL // a string to use in error messages
3430
firstConnectionTime time.Time
35-
lastSuccessTime time.Time // time.Time{} if N/A
31+
32+
body io.ReadCloser // The currently open connection we use to read data, or nil if there is nothing to read from / close.
33+
lastRetryOffset int64
34+
offset int64 // Current offset within the blob
35+
lastSuccessTime time.Time // time.Time{} if N/A
3636
}
3737

3838
// newBodyReader creates a bodyReader for request path in c.
@@ -44,15 +44,15 @@ func newBodyReader(ctx context.Context, c *dockerClient, path string, firstBody
4444
return nil, err
4545
}
4646
res := &bodyReader{
47-
ctx: ctx,
48-
c: c,
49-
47+
ctx: ctx,
48+
c: c,
5049
path: path,
5150
logURL: logURL,
52-
body: firstBody,
53-
lastRetryOffset: 0,
54-
offset: 0,
5551
firstConnectionTime: time.Now(),
52+
53+
body: firstBody,
54+
lastRetryOffset: 0,
55+
offset: 0,
5656
}
5757
return res, nil
5858
}

0 commit comments

Comments
 (0)