-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[patch] Revise S3 reader/writer: compatible with IBM Cloud Object Storage #509
Conversation
Best reviewed: commit by commit
Optimal code review plan (1 warning)
|
Codecov Report
@@ Coverage Diff @@
## master #509 +/- ##
=========================================
- Coverage 8.31% 8.28% -0.04%
=========================================
Files 401 402 +1
Lines 20710 20836 +126
=========================================
+ Hits 1722 1726 +4
- Misses 18742 18860 +118
- Partials 246 250 +4
Continue to review full report at Codecov.
|
[WARNING:INTCFG] Changes in |
bfe78a0
to
e37810d
Compare
da242bf
to
0bb0d0c
Compare
0bb0d0c
to
29a0740
Compare
r.wg.Add(1) | ||
r.eg.Go(safety.RecoverFunc(func() (err error) { | ||
defer r.wg.Done() | ||
defer pw.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
Error return value of pw.Close
is not checked (errcheck)
29a0740
to
de0c46b
Compare
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
de0c46b
to
5b3c39d
Compare
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
59faa29
to
18ac866
Compare
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
5d6b674
to
e13c15d
Compare
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
} | ||
} | ||
|
||
func WithBackoff(enabled bool) Option { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
exported function WithBackoff
should have comment or be unexported (golint)
} | ||
} | ||
|
||
func WithBackoffOpts(opts ...backoff.Option) Option { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
exported function WithBackoffOpts
should have comment or be unexported (golint)
body, err := func() (io.Reader, error) { | ||
if r.backoffEnabled { | ||
return r.getObjectWithBackoff(ctx, offset, r.maxChunkSize) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
if
block ends with a return
statement, so drop this else
and outdent its block (golint)
} | ||
|
||
func (r *reader) getObject(ctx context.Context, offset, length int64) (io.Reader, error) { | ||
log.Debugf("reading %d-%d bytes...", offset, offset+length-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
mnd: Magic number: 1, in detected (gomnd)
|
||
var ( | ||
// io | ||
NewErrContextNotProvided = func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
NewErrContextNotProvided
is a global variable (gochecknoglobals)
return New("context not provided") | ||
} | ||
|
||
NewErrReaderNotProvided = func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
NewErrReaderNotProvided
is a global variable (gochecknoglobals)
return New("io.Reader not provided") | ||
} | ||
|
||
NewErrWriterNotProvided = func() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golangci] reported by reviewdog 🐶
NewErrWriterNotProvided
is a global variable (gochecknoglobals)
/changelog |
Signed-off-by: Rintaro Okamura rintaro.okamura@gmail.com
Description:
max_chunk_size
optionRelated Issue:
Nothing.
How Has This Been Tested?:
On GKE.
Environment:
Types of changes:
Changes to Core Features:
Checklist: