Skip to content

Instantly share code, notes, and snippets.

@luizbranco luizbranco/mock.go
Last active Feb 19, 2018

Embed
What would you like to do?
Mock test interface
type TestingMailer struct {
Emails []Email
Error error
}
func (m *TestingMailer) Mail(e Email) error {
if m.Error != nil {
return m.Error
}
m.Emails = append(m.Emails, e)
return nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.