mockgen/internal/tests/unexported_method/bugreport.go
raw| 1 | package bugreport |
| 2 | |
| 3 | //go:generate mockgen -destination bugreport_mock.go -package bugreport -source=bugreport.go Example |
| 4 | |
| 5 | import "fmt" |
| 6 | |
| 7 | // Example is an interface with a non exported method |
| 8 | type Example interface { |
| 9 | someMethod(string) string |
| 10 | } |
| 11 | |
| 12 | // CallExample is a simple function that uses the interface |
| 13 | func CallExample(e Example) { |
| 14 | fmt.Println(e.someMethod("test")) |
| 15 | } |