Skip to content

Instantly share code, notes, and snippets.

@dansimau
Last active December 2, 2015 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dansimau/fc40c087c61c46f46d40 to your computer and use it in GitHub Desktop.
Save dansimau/fc40c087c61c46f46d40 to your computer and use it in GitHub Desktop.
package foo
type Interface interface {
foo()
}
package bar
type Interface interface {
bar()
}
@dansimau
Copy link
Author

dansimau commented Dec 2, 2015

$ mockery -all
Generating mock for: Interface
Generating mock for: Interface
$ ls -la mocks/
total 8
drwxr-xr-x  3 dan  wheel  102  2 Dec 14:39 ./
drwxr-xr-x  6 dan  wheel  204  2 Dec 14:39 ../
-rw-r--r--  1 dan  wheel  140  2 Dec 14:39 Interface.go
$ cat mocks/Interface.go 
package mocks

import "github.com/stretchr/testify/mock"

type Interface struct {
    mock.Mock
}

func (_m *Interface) bar() {
    _m.Called()
}
$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment