-
Notifications
You must be signed in to change notification settings - Fork 63
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
Features/api generator #122
Conversation
7f06a19
to
89b2da0
Compare
89b2da0
to
0c1b84a
Compare
[Git-flow] Hi @bachue, There are some suggestions for your information: Rebase suggestions
Which seems insignificant, recommend to use For other If you have any questions about this comment, feel free to raise an issue here: |
client/client.go
Outdated
@@ -279,7 +284,7 @@ func ResponseError(resp *http.Response) error { | |||
func CallRet(ctx context.Context, ret interface{}, resp *http.Response) (err error) { | |||
|
|||
defer func() { | |||
io.Copy(ioutil.Discard, resp.Body) | |||
internal_io.SinkAll(resp.Body) |
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-lint] Error return value of internal_io.SinkAll
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
internal/clientv2/client.go
Outdated
@@ -96,7 +98,7 @@ func DoAndDecodeJsonResponse(c Client, options RequestParams, ret interface{}) e | |||
resp, err := Do(c, options) | |||
defer func() { | |||
if resp != nil && resp.Body != nil { | |||
io.Copy(ioutil.Discard, resp.Body) | |||
internal_io.SinkAll(resp.Body) |
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-lint] Error return value of internal_io.SinkAll
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
@@ -113,7 +117,7 @@ func (interceptor *hostsRetryInterceptor) Intercept(req *http.Request, handler H | |||
req = reqBefore | |||
|
|||
if resp != nil && resp.Body != nil { | |||
io.Copy(ioutil.Discard, resp.Body) | |||
internal_io.SinkAll(resp.Body) |
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-lint] Error return value of internal_io.SinkAll
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
internal/io/io.go
Outdated
func ReadAll(r io.Reader) ([]byte, error) { | ||
switch b := r.(type) { | ||
case *BytesNopCloser: | ||
b.Seek(0, io.SeekEnd) |
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-lint] Error return value of b.Seek
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
client/client.go
Outdated
@@ -279,7 +284,7 @@ func ResponseError(resp *http.Response) error { | |||
func CallRet(ctx context.Context, ret interface{}, resp *http.Response) (err error) { | |||
|
|||
defer func() { | |||
io.Copy(ioutil.Discard, resp.Body) | |||
internal_io.SinkAll(resp.Body) |
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-lint] Error return value of internal_io.SinkAll
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
internal/clientv2/client.go
Outdated
@@ -96,7 +98,7 @@ func DoAndDecodeJsonResponse(c Client, options RequestParams, ret interface{}) e | |||
resp, err := Do(c, options) | |||
defer func() { | |||
if resp != nil && resp.Body != nil { | |||
io.Copy(ioutil.Discard, resp.Body) | |||
internal_io.SinkAll(resp.Body) |
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-lint] Error return value of internal_io.SinkAll
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
@@ -113,7 +117,7 @@ func (interceptor *hostsRetryInterceptor) Intercept(req *http.Request, handler H | |||
req = reqBefore | |||
|
|||
if resp != nil && resp.Body != nil { | |||
io.Copy(ioutil.Discard, resp.Body) | |||
internal_io.SinkAll(resp.Body) |
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-lint] Error return value of internal_io.SinkAll
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
internal/io/io.go
Outdated
func ReadAll(r io.Reader) ([]byte, error) { | ||
switch b := r.(type) { | ||
case *BytesNopCloser: | ||
b.Seek(0, io.SeekEnd) |
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-lint] Error return value of b.Seek
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
|
||
if body := request.Body; body != nil { | ||
if bodyJson := body.Json; bodyJson != nil { | ||
bodyJson.generate(group, opts) |
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-lint] Error return value of bodyJson.generate
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
|
||
if body := response.Body; body != nil { | ||
if bodyJson := body.Json; bodyJson != nil { | ||
bodyJson.generate(group, opts) |
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-lint] Error return value of bodyJson.generate
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
storagev2/uptoken/putpolicy.go
Outdated
|
||
// SetScope 指定上传的目标资源空间 Bucket 和资源键 Key | ||
func (putPolicy PutPolicy) SetScope(value string) PutPolicy { | ||
putPolicy.Set(putPolicyKeyScope, value) |
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-lint] Error return value of putPolicy.Set
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
storagev2/uptoken/putpolicy.go
Outdated
|
||
// SetDeadline 指定上传策略有效截止时间 | ||
func (putPolicy PutPolicy) SetDeadline(value int64) PutPolicy { | ||
putPolicy.Set(putPolicyKeyDeadline, value) |
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-lint] Error return value of putPolicy.Set
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
storagev2/uptoken/putpolicy.go
Outdated
|
||
// SetIsPrefixalScope 指定是否允许用户上传以 scope 的 keyPrefix 为前缀的文件 | ||
func (putPolicy PutPolicy) SetIsPrefixalScope(value int64) PutPolicy { | ||
putPolicy.Set(putPolicyKeyIsPrefixalScope, value) |
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-lint] Error return value of putPolicy.Set
is not checked (errcheck)
If you have any questions about this comment, feel free to raise an issue here:
… remove some useless json.Marshaler and json.Unmarshaler implementations, remove useless blocks
507bb22
to
7b41f89
Compare
KODO-19449
KODO-18801