From 5d02d74a4991a21a95ffe70f13f649fa26c9382a Mon Sep 17 00:00:00 2001 From: Lena Fuhrimann <6780471+cloudlena@users.noreply.github.com> Date: Thu, 2 Aug 2018 15:45:38 +0200 Subject: [PATCH] Disable lll linter --- .travis.yml | 2 +- Makefile | 2 +- README.md | 2 +- go.mod | 11 +- go.sum | 22 +-- internal/app/s3manager/s3_test.go | 268 +++++++++++++++--------------- 6 files changed, 146 insertions(+), 161 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41b47ea..c853e95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ before_install: - go get -u github.com/golangci/golangci-lint/cmd/golangci-lint install: - - vgo mod -vendor + - vgo mod vendor script: - make lint diff --git a/Makefile b/Makefile index 406912d..4351ee8 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ all: go build ./cmd/s3manager lint: - golangci-lint run --enable-all + golangci-lint run --enable-all --disable lll test: go test -race -cover ./... diff --git a/README.md b/README.md index d92967a..17e71c3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A Web GUI written in Go to manage S3 buckets from any provider. ## Install Dependencies 1. Install [vgo](https://github.com/golang/vgo) -1. Run `vgo mod -vendor` +1. Run `vgo mod vendor` ## Build and Run Locally diff --git a/go.mod b/go.mod index 964acb4..44488f8 100644 --- a/go.mod +++ b/go.mod @@ -2,19 +2,14 @@ module github.com/mastertinner/s3manager require ( github.com/go-ini/ini v1.38.1 // indirect - github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f // indirect - github.com/jtolds/gls v4.2.1+incompatible // indirect github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a github.com/matryer/is v1.1.0 github.com/matryer/way v0.0.0-20180416093233-9632d0c407b0 github.com/minio/minio-go v6.0.5+incompatible github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff // indirect github.com/pkg/errors v0.8.0 - github.com/smartystreets/assertions v0.0.0-20180725160413-e900ae048470 // indirect - github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect - golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb // indirect - golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a // indirect - golang.org/x/sys v0.0.0-20180801221139-3dc4335d56c7 // indirect + golang.org/x/crypto v0.0.0-20180807104621-f027049dab0a // indirect + golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24 // indirect + golang.org/x/sys v0.0.0-20180808154034-904bdc257025 // indirect golang.org/x/text v0.3.0 // indirect - gopkg.in/ini.v1 v1.38.1 // indirect ) diff --git a/go.sum b/go.sum index 545fb50..6f2b0d0 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ github.com/go-ini/ini v1.38.1 h1:hbtfM8emWUVo9GnXSloXYyFbXxZ+tG6sbepSStoe1FY= github.com/go-ini/ini v1.38.1/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f h1:FDM3EtwZLyhW48YRiyqjivNlNZjAObv4xt4NnJaU+NQ= -github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a h1:zfKot2b2ghanQHXgxFuhRjBsHceUM2nyKB/6+Uzs0nc= github.com/mastertinner/adapters v0.0.0-20180704153523-13d009731b3a/go.mod h1:+CmkQ6q1+eiIdmwd2m4kBj8xAcIjlIVAesWwv9YmuXY= github.com/matryer/is v1.1.0 h1:VWTaJ7O+aCteFVVE16QjvBNDDHVK26TN0pHFRUPRIgY= @@ -16,17 +12,11 @@ github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff h1:jM4Eo4qMmm github.com/mitchellh/go-homedir v0.0.0-20180801233206-58046073cbff/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/smartystreets/assertions v0.0.0-20180725160413-e900ae048470 h1:R0uuDVEvfDha2O6dfJRr4/5NBHKEbZhMPZmqOWpEkSo= -github.com/smartystreets/assertions v0.0.0-20180725160413-e900ae048470/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbmil4Ui/dDdFBExb7/cmkNjyX5F97oglmvCDo= -github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb h1:Ah9YqXLj6fEgeKqcmBuLCbAsrF3ScD7dJ/bYM0C6tXI= -golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a h1:8fCF9zjAir2SP3N+axz9xs+0r4V8dqPzqsWO10t8zoo= -golang.org/x/net v0.0.0-20180801234040-f4c29de78a2a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sys v0.0.0-20180801221139-3dc4335d56c7 h1:tr8zzCvQ7aQaYQ5nOInKN9jN9ujD92ktUtiEpN/b+tE= -golang.org/x/sys v0.0.0-20180801221139-3dc4335d56c7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/crypto v0.0.0-20180807104621-f027049dab0a h1:PulT0Y50PcfTWomfsD39bSQyVrjjWdIuJKfyR4nOCJw= +golang.org/x/crypto v0.0.0-20180807104621-f027049dab0a/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24 h1:mEsFm194MmS9vCwxFy+zwu0EU7ZkxxMD1iH++vmGdUY= +golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sys v0.0.0-20180808154034-904bdc257025 h1:vE4lpaOfhRi5ci1V4lyWFx2Rg3CXZNaN09Q1e+GKioA= +golang.org/x/sys v0.0.0-20180808154034-904bdc257025/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -gopkg.in/ini.v1 v1.38.1 h1:8E3nEICVJ6kxl6aTXYp77xYyObhw7YG9/avdj0r3vME= -gopkg.in/ini.v1 v1.38.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/internal/app/s3manager/s3_test.go b/internal/app/s3manager/s3_test.go index 53686c0..3cfca80 100644 --- a/internal/app/s3manager/s3_test.go +++ b/internal/app/s3manager/s3_test.go @@ -1,4 +1,4 @@ -// Code generated by moq; DO NOT EDIT +// Code generated by moq; DO NOT EDIT. // github.com/matryer/moq package s3manager_test @@ -25,25 +25,25 @@ var ( // // // make and configure a mocked S3 // mockedS3 := &S3Mock{ -// GetObjectFunc: func(in1 string, in2 string, in3 minio.GetObjectOptions) (*minio.Object, error) { +// GetObjectFunc: func(bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error) { // panic("TODO: mock out the GetObject method") // }, // ListBucketsFunc: func() ([]minio.BucketInfo, error) { // panic("TODO: mock out the ListBuckets method") // }, -// ListObjectsV2Func: func(in1 string, in2 string, in3 bool, in4 <-chan struct{}) <-chan minio.ObjectInfo { +// ListObjectsV2Func: func(bucketName string, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo { // panic("TODO: mock out the ListObjectsV2 method") // }, -// MakeBucketFunc: func(in1 string, in2 string) error { +// MakeBucketFunc: func(bucketName string, location string) error { // panic("TODO: mock out the MakeBucket method") // }, -// PutObjectFunc: func(in1 string, in2 string, in3 io.Reader, in4 int64, in5 minio.PutObjectOptions) (int64, error) { +// PutObjectFunc: func(bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (int64, error) { // panic("TODO: mock out the PutObject method") // }, -// RemoveBucketFunc: func(in1 string) error { +// RemoveBucketFunc: func(bucketName string) error { // panic("TODO: mock out the RemoveBucket method") // }, -// RemoveObjectFunc: func(in1 string, in2 string) error { +// RemoveObjectFunc: func(bucketName string, objectName string) error { // panic("TODO: mock out the RemoveObject method") // }, // } @@ -54,118 +54,118 @@ var ( // } type S3Mock struct { // GetObjectFunc mocks the GetObject method. - GetObjectFunc func(in1 string, in2 string, in3 minio.GetObjectOptions) (*minio.Object, error) + GetObjectFunc func(bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error) // ListBucketsFunc mocks the ListBuckets method. ListBucketsFunc func() ([]minio.BucketInfo, error) // ListObjectsV2Func mocks the ListObjectsV2 method. - ListObjectsV2Func func(in1 string, in2 string, in3 bool, in4 <-chan struct{}) <-chan minio.ObjectInfo + ListObjectsV2Func func(bucketName string, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo // MakeBucketFunc mocks the MakeBucket method. - MakeBucketFunc func(in1 string, in2 string) error + MakeBucketFunc func(bucketName string, location string) error // PutObjectFunc mocks the PutObject method. - PutObjectFunc func(in1 string, in2 string, in3 io.Reader, in4 int64, in5 minio.PutObjectOptions) (int64, error) + PutObjectFunc func(bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (int64, error) // RemoveBucketFunc mocks the RemoveBucket method. - RemoveBucketFunc func(in1 string) error + RemoveBucketFunc func(bucketName string) error // RemoveObjectFunc mocks the RemoveObject method. - RemoveObjectFunc func(in1 string, in2 string) error + RemoveObjectFunc func(bucketName string, objectName string) error // calls tracks calls to the methods. calls struct { // GetObject holds details about calls to the GetObject method. GetObject []struct { - // In1 is the in1 argument value. - In1 string - // In2 is the in2 argument value. - In2 string - // In3 is the in3 argument value. - In3 minio.GetObjectOptions + // BucketName is the bucketName argument value. + BucketName string + // ObjectName is the objectName argument value. + ObjectName string + // Opts is the opts argument value. + Opts minio.GetObjectOptions } // ListBuckets holds details about calls to the ListBuckets method. ListBuckets []struct { } // ListObjectsV2 holds details about calls to the ListObjectsV2 method. ListObjectsV2 []struct { - // In1 is the in1 argument value. - In1 string - // In2 is the in2 argument value. - In2 string - // In3 is the in3 argument value. - In3 bool - // In4 is the in4 argument value. - In4 <-chan struct{} + // BucketName is the bucketName argument value. + BucketName string + // ObjectPrefix is the objectPrefix argument value. + ObjectPrefix string + // Recursive is the recursive argument value. + Recursive bool + // DoneCh is the doneCh argument value. + DoneCh <-chan struct{} } // MakeBucket holds details about calls to the MakeBucket method. MakeBucket []struct { - // In1 is the in1 argument value. - In1 string - // In2 is the in2 argument value. - In2 string + // BucketName is the bucketName argument value. + BucketName string + // Location is the location argument value. + Location string } // PutObject holds details about calls to the PutObject method. PutObject []struct { - // In1 is the in1 argument value. - In1 string - // In2 is the in2 argument value. - In2 string - // In3 is the in3 argument value. - In3 io.Reader - // In4 is the in4 argument value. - In4 int64 - // In5 is the in5 argument value. - In5 minio.PutObjectOptions + // BucketName is the bucketName argument value. + BucketName string + // ObjectName is the objectName argument value. + ObjectName string + // Reader is the reader argument value. + Reader io.Reader + // ObjectSize is the objectSize argument value. + ObjectSize int64 + // Opts is the opts argument value. + Opts minio.PutObjectOptions } // RemoveBucket holds details about calls to the RemoveBucket method. RemoveBucket []struct { - // In1 is the in1 argument value. - In1 string + // BucketName is the bucketName argument value. + BucketName string } // RemoveObject holds details about calls to the RemoveObject method. RemoveObject []struct { - // In1 is the in1 argument value. - In1 string - // In2 is the in2 argument value. - In2 string + // BucketName is the bucketName argument value. + BucketName string + // ObjectName is the objectName argument value. + ObjectName string } } } // GetObject calls GetObjectFunc. -func (mock *S3Mock) GetObject(in1 string, in2 string, in3 minio.GetObjectOptions) (*minio.Object, error) { +func (mock *S3Mock) GetObject(bucketName string, objectName string, opts minio.GetObjectOptions) (*minio.Object, error) { if mock.GetObjectFunc == nil { - panic("moq: S3Mock.GetObjectFunc is nil but S3.GetObject was just called") + panic("S3Mock.GetObjectFunc: method is nil but S3.GetObject was just called") } callInfo := struct { - In1 string - In2 string - In3 minio.GetObjectOptions + BucketName string + ObjectName string + Opts minio.GetObjectOptions }{ - In1: in1, - In2: in2, - In3: in3, + BucketName: bucketName, + ObjectName: objectName, + Opts: opts, } lockS3MockGetObject.Lock() mock.calls.GetObject = append(mock.calls.GetObject, callInfo) lockS3MockGetObject.Unlock() - return mock.GetObjectFunc(in1, in2, in3) + return mock.GetObjectFunc(bucketName, objectName, opts) } // GetObjectCalls gets all the calls that were made to GetObject. // Check the length with: // len(mockedS3.GetObjectCalls()) func (mock *S3Mock) GetObjectCalls() []struct { - In1 string - In2 string - In3 minio.GetObjectOptions + BucketName string + ObjectName string + Opts minio.GetObjectOptions } { var calls []struct { - In1 string - In2 string - In3 minio.GetObjectOptions + BucketName string + ObjectName string + Opts minio.GetObjectOptions } lockS3MockGetObject.RLock() calls = mock.calls.GetObject @@ -176,7 +176,7 @@ func (mock *S3Mock) GetObjectCalls() []struct { // ListBuckets calls ListBucketsFunc. func (mock *S3Mock) ListBuckets() ([]minio.BucketInfo, error) { if mock.ListBucketsFunc == nil { - panic("moq: S3Mock.ListBucketsFunc is nil but S3.ListBuckets was just called") + panic("S3Mock.ListBucketsFunc: method is nil but S3.ListBuckets was just called") } callInfo := struct { }{} @@ -200,41 +200,41 @@ func (mock *S3Mock) ListBucketsCalls() []struct { } // ListObjectsV2 calls ListObjectsV2Func. -func (mock *S3Mock) ListObjectsV2(in1 string, in2 string, in3 bool, in4 <-chan struct{}) <-chan minio.ObjectInfo { +func (mock *S3Mock) ListObjectsV2(bucketName string, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo { if mock.ListObjectsV2Func == nil { - panic("moq: S3Mock.ListObjectsV2Func is nil but S3.ListObjectsV2 was just called") + panic("S3Mock.ListObjectsV2Func: method is nil but S3.ListObjectsV2 was just called") } callInfo := struct { - In1 string - In2 string - In3 bool - In4 <-chan struct{} + BucketName string + ObjectPrefix string + Recursive bool + DoneCh <-chan struct{} }{ - In1: in1, - In2: in2, - In3: in3, - In4: in4, + BucketName: bucketName, + ObjectPrefix: objectPrefix, + Recursive: recursive, + DoneCh: doneCh, } lockS3MockListObjectsV2.Lock() mock.calls.ListObjectsV2 = append(mock.calls.ListObjectsV2, callInfo) lockS3MockListObjectsV2.Unlock() - return mock.ListObjectsV2Func(in1, in2, in3, in4) + return mock.ListObjectsV2Func(bucketName, objectPrefix, recursive, doneCh) } // ListObjectsV2Calls gets all the calls that were made to ListObjectsV2. // Check the length with: // len(mockedS3.ListObjectsV2Calls()) func (mock *S3Mock) ListObjectsV2Calls() []struct { - In1 string - In2 string - In3 bool - In4 <-chan struct{} + BucketName string + ObjectPrefix string + Recursive bool + DoneCh <-chan struct{} } { var calls []struct { - In1 string - In2 string - In3 bool - In4 <-chan struct{} + BucketName string + ObjectPrefix string + Recursive bool + DoneCh <-chan struct{} } lockS3MockListObjectsV2.RLock() calls = mock.calls.ListObjectsV2 @@ -243,33 +243,33 @@ func (mock *S3Mock) ListObjectsV2Calls() []struct { } // MakeBucket calls MakeBucketFunc. -func (mock *S3Mock) MakeBucket(in1 string, in2 string) error { +func (mock *S3Mock) MakeBucket(bucketName string, location string) error { if mock.MakeBucketFunc == nil { - panic("moq: S3Mock.MakeBucketFunc is nil but S3.MakeBucket was just called") + panic("S3Mock.MakeBucketFunc: method is nil but S3.MakeBucket was just called") } callInfo := struct { - In1 string - In2 string + BucketName string + Location string }{ - In1: in1, - In2: in2, + BucketName: bucketName, + Location: location, } lockS3MockMakeBucket.Lock() mock.calls.MakeBucket = append(mock.calls.MakeBucket, callInfo) lockS3MockMakeBucket.Unlock() - return mock.MakeBucketFunc(in1, in2) + return mock.MakeBucketFunc(bucketName, location) } // MakeBucketCalls gets all the calls that were made to MakeBucket. // Check the length with: // len(mockedS3.MakeBucketCalls()) func (mock *S3Mock) MakeBucketCalls() []struct { - In1 string - In2 string + BucketName string + Location string } { var calls []struct { - In1 string - In2 string + BucketName string + Location string } lockS3MockMakeBucket.RLock() calls = mock.calls.MakeBucket @@ -278,45 +278,45 @@ func (mock *S3Mock) MakeBucketCalls() []struct { } // PutObject calls PutObjectFunc. -func (mock *S3Mock) PutObject(in1 string, in2 string, in3 io.Reader, in4 int64, in5 minio.PutObjectOptions) (int64, error) { +func (mock *S3Mock) PutObject(bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (int64, error) { if mock.PutObjectFunc == nil { - panic("moq: S3Mock.PutObjectFunc is nil but S3.PutObject was just called") + panic("S3Mock.PutObjectFunc: method is nil but S3.PutObject was just called") } callInfo := struct { - In1 string - In2 string - In3 io.Reader - In4 int64 - In5 minio.PutObjectOptions + BucketName string + ObjectName string + Reader io.Reader + ObjectSize int64 + Opts minio.PutObjectOptions }{ - In1: in1, - In2: in2, - In3: in3, - In4: in4, - In5: in5, + BucketName: bucketName, + ObjectName: objectName, + Reader: reader, + ObjectSize: objectSize, + Opts: opts, } lockS3MockPutObject.Lock() mock.calls.PutObject = append(mock.calls.PutObject, callInfo) lockS3MockPutObject.Unlock() - return mock.PutObjectFunc(in1, in2, in3, in4, in5) + return mock.PutObjectFunc(bucketName, objectName, reader, objectSize, opts) } // PutObjectCalls gets all the calls that were made to PutObject. // Check the length with: // len(mockedS3.PutObjectCalls()) func (mock *S3Mock) PutObjectCalls() []struct { - In1 string - In2 string - In3 io.Reader - In4 int64 - In5 minio.PutObjectOptions + BucketName string + ObjectName string + Reader io.Reader + ObjectSize int64 + Opts minio.PutObjectOptions } { var calls []struct { - In1 string - In2 string - In3 io.Reader - In4 int64 - In5 minio.PutObjectOptions + BucketName string + ObjectName string + Reader io.Reader + ObjectSize int64 + Opts minio.PutObjectOptions } lockS3MockPutObject.RLock() calls = mock.calls.PutObject @@ -325,29 +325,29 @@ func (mock *S3Mock) PutObjectCalls() []struct { } // RemoveBucket calls RemoveBucketFunc. -func (mock *S3Mock) RemoveBucket(in1 string) error { +func (mock *S3Mock) RemoveBucket(bucketName string) error { if mock.RemoveBucketFunc == nil { - panic("moq: S3Mock.RemoveBucketFunc is nil but S3.RemoveBucket was just called") + panic("S3Mock.RemoveBucketFunc: method is nil but S3.RemoveBucket was just called") } callInfo := struct { - In1 string + BucketName string }{ - In1: in1, + BucketName: bucketName, } lockS3MockRemoveBucket.Lock() mock.calls.RemoveBucket = append(mock.calls.RemoveBucket, callInfo) lockS3MockRemoveBucket.Unlock() - return mock.RemoveBucketFunc(in1) + return mock.RemoveBucketFunc(bucketName) } // RemoveBucketCalls gets all the calls that were made to RemoveBucket. // Check the length with: // len(mockedS3.RemoveBucketCalls()) func (mock *S3Mock) RemoveBucketCalls() []struct { - In1 string + BucketName string } { var calls []struct { - In1 string + BucketName string } lockS3MockRemoveBucket.RLock() calls = mock.calls.RemoveBucket @@ -356,33 +356,33 @@ func (mock *S3Mock) RemoveBucketCalls() []struct { } // RemoveObject calls RemoveObjectFunc. -func (mock *S3Mock) RemoveObject(in1 string, in2 string) error { +func (mock *S3Mock) RemoveObject(bucketName string, objectName string) error { if mock.RemoveObjectFunc == nil { - panic("moq: S3Mock.RemoveObjectFunc is nil but S3.RemoveObject was just called") + panic("S3Mock.RemoveObjectFunc: method is nil but S3.RemoveObject was just called") } callInfo := struct { - In1 string - In2 string + BucketName string + ObjectName string }{ - In1: in1, - In2: in2, + BucketName: bucketName, + ObjectName: objectName, } lockS3MockRemoveObject.Lock() mock.calls.RemoveObject = append(mock.calls.RemoveObject, callInfo) lockS3MockRemoveObject.Unlock() - return mock.RemoveObjectFunc(in1, in2) + return mock.RemoveObjectFunc(bucketName, objectName) } // RemoveObjectCalls gets all the calls that were made to RemoveObject. // Check the length with: // len(mockedS3.RemoveObjectCalls()) func (mock *S3Mock) RemoveObjectCalls() []struct { - In1 string - In2 string + BucketName string + ObjectName string } { var calls []struct { - In1 string - In2 string + BucketName string + ObjectName string } lockS3MockRemoveObject.RLock() calls = mock.calls.RemoveObject