Closed kkesley closed 5 years ago
am having a similar issue with sqsiface:
$ mockgen -source=~/Code/go/src/github.com/aws/aws-sdk-go/service/sqs/sqsiface/interface.go -destination=mockSQS.go
2019/06/25 11:10:56 Loading input failed: loading package failed
Update: resolved! specify the full path, ~ are not treated correctly
@kkesley the documentation specifies that aws.Context
is just an alias to context.Context
which is also an interface.
https://docs.aws.amazon.com/sdk-for-go/api/aws/#Context
Do you have repro steps?
I got this error:
cannot use mockS3 (type mock_s3iface.MockS3API) as type s3iface.S3API in field value: mock_s3iface.MockS3API does not implement s3iface.S3API (wrong type for AbortMultipartUploadWithContext method) have AbortMultipartUploadWithContext(context.Context, s3.AbortMultipartUploadInput, ...request.Option) (s3.AbortMultipartUploadOutput, error) want AbortMultipartUploadWithContext(aws.Context, s3.AbortMultipartUploadInput, ...request.Option) (s3.AbortMultipartUploadOutput, error)
However after experimenting with the project, it turns out that the problem is caused by different version of the iface
and aws-sdk
. Which is not related to the library.
I'm closing this.
Thanks!
Hi, I'm trying to mock s3iface, however, some methods with
aws.Context
seems to be mocked differently. Here's one example:mock:
interface:
note the difference in the first arg:
context.Context
vsaws.Context
it results in type error when passing to my function. Is there any resolution to this?
Note: this is how I generated those mocks:
mockgen -destination s3iface/mock_s3iface.go github.com/aws/aws-sdk-go/service/s3/s3iface S3API