Should provide named argument in interface `Storage`
unknowntpo opened this issue · comments
Eric Chang commented
e.g. In CreateBucket()
method, the second argument is bucket name
, the third argument is region
,
but it's hard to know which argument we need to provide without digging into actual implementation.
// Storage for s3 and disk
type Storage interface {
// CreateBucket for create new folder
CreateBucket(context.Context, string, string) error
}
So, it should be:
// Storage for s3 and disk
type Storage interface {
// CreateBucket for create new folder
CreateBucket(ctx context.Context, bucketName string, region string) error
}