Skip to content

LoggerMock can not use as the type ctxd.Logger  #7

@dohernandez

Description

@dohernandez

When I tried to use an instance of LoggerMock as a ctxd.Logger, I get the following error:

Cannot use 'l' (type LoggerMock) as the type ctxd.Logger Type does not implement 'ctxd.Logger' as the 'Debug' method has a pointer receiver
import "github.com/bool64/ctxd"

type Server struct {
    log      ctxd.Logger
}

func NewServer(log ctxd.Logger) *Server {
    return &Server{log: log}
}

l := ctxd.LoggerMock{}

s := NewServer(l)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions