MCPcopy Create free account
hub / github.com/goadesign/goa / relativeToWorkdir

Function relativeToWorkdir

eval/error_location_test.go:69–85  ·  view source on GitHub ↗
(t *testing.T, file string)

Source from the content-addressed store, hash-verified

67func (e *testExpr) DSL() func() { return e.dsl }
68
69func relativeToWorkdir(t *testing.T, file string) string {
70 t.Helper()
71
72 wd, err := os.Getwd()
73 if err != nil {
74 t.Fatalf("os.Getwd failed: %v", err)
75 }
76 wd, err = filepath.Abs(wd)
77 if err != nil {
78 t.Fatalf("filepath.Abs failed: %v", err)
79 }
80 rel, err := filepath.Rel(wd, file)
81 if err != nil {
82 t.Fatalf("filepath.Rel failed: %v", err)
83 }
84 return rel
85}
86
87func itoa(v int) string {
88 // Avoid pulling fmt/strconv into this focused test.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected