gojuno / minimock

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

Package name in generated doc string seems odd #117

Open FlorianLoch opened 3 weeks ago

FlorianLoch commented 3 weeks ago

I have an interface for which I generate a mock using:

//go:generate go run github.com/gojuno/minimock/v3/cmd/minimock -g -s _mock.go -i ./api.MyClient -o ./internal/api/mocks/

It generates me the following code:

import (
    "context"
    "sync"
    mm_atomic "sync/atomic"
    mm_time "time"

    "github.com/florianloch/some_service/api"
    "github.com/gojuno/minimock/v3"
)

// MyClientMock implements mm_api.MyClient
type MyClientMock struct {

It of course does not affect compilation but it's irritating to get the package name prefixed with mm_ in the doc string.

If that is something worth fixing I could take a look at it.

zcolleen commented 3 weeks ago

Hey @FlorianLoch thanks for issue! That happens because here we prefix source package with mm which then converts to interface type name.

I think this certainly worth fixing, so if you could take a look that would be cool