Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid fast-failing on unresolved imports that aren't used in the target interface #182

Open
FastNav opened this issue Jun 20, 2021 · 0 comments

Comments

@FastNav
Copy link

FastNav commented Jun 20, 2021

For example, the mock generator should still operate on a file like this:

package example

import (
    nonexistent "fake.com/this/package/doesnt/exist"
)

type Fooer interface {
     SayHello(audience string) string
}

func ProcessFooer(f Fooer) nonexistent.Report {
    return nonexistent.NewReport().WithFooer(f)
}

This is useful for tooling (namely Bazel tooling) that can be optimized to run Counterfeiter on a generated GOPATH that only includes strictly useful dependencies of an API. Such optimizations currently cause Counterfeiter to crash due to unresolved import errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant