MCPcopy Create free account
hub / github.com/maruel/panicparse / getPanicParseDir

Function getPanicParseDir

stack/context_test.go:2492–2503  ·  view source on GitHub ↗

getPanicParseDir returns the path to the root directory of panicparse package, using "/" as path separator.

(t *testing.T)

Source from the content-addressed store, hash-verified

2490// getPanicParseDir returns the path to the root directory of panicparse
2491// package, using "/" as path separator.
2492func getPanicParseDir(t *testing.T) string {
2493 // We assume that the working directory is the directory containing this
2494 // source. In Go test framework, this normally holds true. If this ever
2495 // becomes false, let's fix this.
2496 thisDir, err := os.Getwd()
2497 if err != nil {
2498 t.Fatal(err)
2499 }
2500 // "/" is used even on Windows in the stack trace, return in this format to
2501 // simply our life.
2502 return strings.Replace(filepath.Dir(thisDir), "\\", "/", -1)
2503}
2504
2505func createTree(t *testing.T, root string, tree map[string]string) {
2506 for path, content := range tree {

Callers 3

TestPanicFunction · 0.85
TestPanicwebFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…