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

Function dslDeclLocation

eval/run_dsl_error_location_test.go:123–133  ·  view source on GitHub ↗
(t *testing.T, fn func())

Source from the content-addressed store, hash-verified

121func (e *runDSLExpr) Validate() error { return e.validate }
122
123func dslDeclLocation(t *testing.T, fn func()) (file string, line int) {
124 t.Helper()
125
126 pc := reflect.ValueOf(fn).Pointer()
127 f := runtime.FuncForPC(pc)
128 if f == nil {
129 t.Fatal("runtime.FuncForPC returned nil")
130 }
131 file, line = f.FileLine(pc)
132 return relativeToWorkdir(t, file), line
133}

Callers 1

Calls 1

relativeToWorkdirFunction · 0.70

Tested by

no test coverage detected