Skip to content

go test: mock multi contract interface: embed self #21

@AmitKumarDas

Description

@AmitKumarDas
type mockFileInfo struct {
  name string
  typ fs.FileMode

  // Stub out everything but Name() & Type()
  fs.DirEntry // nice: does this lazy stuff really work
}

var _ fs.DirEntry = (*mockFileInfo)(nil)

func (fi *mockFileInfo) Name() string { return [fi.name](http://fi.name/) }
func (fi *mockFileInfo) Type() fs.FileMode { return fi.typ }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions