MCPcopy
hub / github.com/cheat/cheat / Path

Function Path

mocks/path.go:12–23  ·  view source on GitHub ↗

Path returns the absolute path to the specified mock file within the mocks/ directory.

(filename string)

Source from the content-addressed store, hash-verified

10// Path returns the absolute path to the specified mock file within
11// the mocks/ directory.
12func 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}

Callers 8

TestSheetSuccessFunction · 0.92
TestSheetFailureFunction · 0.92
TestLoadFunction · 0.92
TestConfigSuccessfulFunction · 0.92
TestEditorEnvOverrideFunction · 0.92
TestEditorEnvFallbackFunction · 0.92
TestConfigDefaultsFunction · 0.92

Calls

no outgoing calls

Tested by 8

TestSheetSuccessFunction · 0.74
TestSheetFailureFunction · 0.74
TestLoadFunction · 0.74
TestConfigSuccessfulFunction · 0.74
TestEditorEnvOverrideFunction · 0.74
TestEditorEnvFallbackFunction · 0.74
TestConfigDefaultsFunction · 0.74