ooni-probe-cli/internal/model/mocks/writer.go
Simone Basso 34dc029b33
feat(miniooni): optionally log using emojis (#932)
As silly as it seems, emojis help _a lot_ when eyeballing logs
to quickly identify unexpected lines.

I'm doing this work as part of https://github.com/ooni/probe/issues/2257
2022-09-05 10:06:44 +02:00

17 lines
305 B
Go

package mocks
import "io"
// Writer allows to mock any io.Writer.
type Writer struct {
MockWrite func(b []byte) (int, error)
}
// Writer implements an io.Writer.
var _ io.Writer = &Writer{}
// Write implements io.Writer.Write.
func (r *Writer) Write(b []byte) (int, error) {
return r.MockWrite(b)
}