Path returns the absolute path to the specified mock file within the mocks/ directory.
(filename string)
| 10 | // Path returns the absolute path to the specified mock file within |
| 11 | // the mocks/ directory. |
| 12 | func Path(filename string) string { |
| 13 | _, thisfile, _, _ := runtime.Caller(0) |
| 14 | |
| 15 | file, err := filepath.Abs( |
| 16 | filepath.Join(filepath.Dir(thisfile), filename), |
| 17 | ) |
| 18 | if err != nil { |
| 19 | panic(fmt.Errorf("failed to resolve mock path: %v", err)) |
| 20 | } |
| 21 | |
| 22 | return file |
| 23 | } |
no outgoing calls