Skip to content

Interface fakes generated in the same package as the interface cause an import cycle #103

@alexkohler

Description

@alexkohler

Suppose you have the following interface:

package abc
//go:generate $GOPATH/src/github.com/maxbrunsfeld/counterfeiter/counterfeiter -o FakeFoo.go . Foo

type Foo interface {
	Bar() error
}

After generating fakes, the output fake includes the following line to ensure FakeFoo is meeting the abc.Foo interface:

var _ abc.Foo = new(FakeFoo)

Note that we output this fake to the abc package, so the abc. identifier in front of Foo is not necessary, and actually causes an import cycle.

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