Last active
April 27, 2018 17:47
-
-
Save prantoran/a98c8061c74e1d6506c27229f9743de1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mocks | |
import "github.com/prantoran/go-mock-microservice/printer" | |
type PrintFunc func(string) (*printer.Resp, error) | |
type MockPrinter struct { | |
MockPrintFunc PrintFunc | |
} | |
func (m *MockPrinter) SetPrintFunc(f PrintFunc) { | |
m.MockPrintFunc = f | |
} | |
func (m *MockPrinter) Print(s string) (*printer.Resp, error) { | |
return m.MockPrintFunc(s) | |
} | |
func NewMockPrinter() *MockPrinter { | |
return &MockPrinter{} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment