// myFunc uses an SDK service client to make a request to // Amazon Simple Storage Service. funcmyFunc(svc s3iface.S3API)bool { // Make svc.AbortMultipartUpload request }
// Define a mock struct to be used in your unit tests of myFunc. type mockS3Client struct { s3iface.S3API } func(m *mockS3Client)AbortMultipartUpload(input *s3.AbortMultipartUploadInput)(*s3.AbortMultipartUploadOutput, error) { // mock response/functionality }
funcTestMyFunc(t *testing.T) { // Setup Test mockSvc := &mockS3Client{}