Skip to content

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

@FastNav

Description

@FastNav

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions