Skip to content

Instantly share code, notes, and snippets.

@zapkub
Created November 19, 2019 03:28
Show Gist options
  • Save zapkub/e3f74cdd60113f881da75bd86306d16e to your computer and use it in GitHub Desktop.
Save zapkub/e3f74cdd60113f881da75bd86306d16e to your computer and use it in GitHub Desktop.
Another appoarch of fake type
type Random interface {
Number(min, max int) int
String(char []byte) string
}
type FakeRandomPreparer struct {
}
func (f *FakeRandomPreparer) NumberAllAny() {
}
type FakeRandom struct {
Prepare *FakeRandomPreparer
}
func (f FakeRandom) Number(min, max int) int {
panic("implement me")
}
func (f FakeRandom) String(char []byte) string {
panic("implement me")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment