Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianyi Wang committed Nov 6, 2024
1 parent 52b37fe commit 51a6ea0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
3 changes: 0 additions & 3 deletions feature/s3/transfermanager/api_op_PutObject.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ type multipartUploadError struct {

// Error returns the string representation of the error.
//
// # See apierr.BaseError ErrorWithExtra for output format
//
// Satisfies the error interface.
func (m *multipartUploadError) Error() string {
var extra string
Expand Down Expand Up @@ -936,7 +934,6 @@ func (u *multiUploader) seterr(e error) {
u.err = e
}

// fail will abort the multipart unless LeavePartsOnError is set to true.
func (u *multiUploader) fail(ctx context.Context, clientOptions ...func(*s3.Options)) {
params := u.in.mapAbortMultipartUploadInput(u.uploadID)
_, err := u.options.S3.AbortMultipartUpload(ctx, params, clientOptions...)
Expand Down
12 changes: 2 additions & 10 deletions feature/s3/transfermanager/internal/testing/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"slices"
"sync"

"github.com/aws/aws-sdk-go-v2/aws"
Expand Down Expand Up @@ -68,7 +69,7 @@ func (f httpDoFunc) Do(r *http.Request) (*http.Response, error) {
}

func (u *UploadLoggingClient) traceOperation(name string, params interface{}) {
if contains(u.ignoredOperations, name) {
if slices.Contains(u.ignoredOperations, name) {
return
}
u.Invocations = append(u.Invocations, name)
Expand Down Expand Up @@ -190,12 +191,3 @@ func NewUploadLoggingClient(ignoredOps []string) (*UploadLoggingClient, *[]strin

return c, &c.Invocations, &c.Params
}

func contains(src []string, s string) bool {
for _, v := range src {
if v == s {
return true
}
}
return false
}

0 comments on commit 51a6ea0

Please sign in to comment.