gojuno / minimock

Powerful mock generation tool for Go programming language
MIT License
577 stars 38 forks source link

FeatureRequest: named input arguments for functions #22

Closed beono closed 5 years ago

beono commented 5 years ago

For example, I have an interface:

type FileUploader interface {
    Save(ctx context.Context, Data []byte, Filename string) (*FileInfo, error)
}

Than, I have to work with arguments p, p1, p2.

mockFileStorage.SaveMock.Set(func(p context.Context, p1 []byte, p2 string) (r *FileInfo, r1 error) {

Instead, I would like to see names of variables according to interface declaration (ctx, Data, Filename). Also I don't think we need to pre allocate return values (r and r1)

mockFileStorage.SaveMock.Set(func(ctx context.Context, Data []byte, Filename string) (*FileInfo, error) {
hexdigest commented 5 years ago

Hi @beono

Sorry for the delayed response. This should be fixed with minimock v2.0.0 please check it out and feel free to reopen the issue if the problem still exists.