MCPcopy
hub / github.com/labstack/echo / LoadBytes

Function LoadBytes

echotest/reader.go:26–34  ·  view source on GitHub ↗

LoadBytes is helper to load file contents relative to current (where test file is) package directory.

(t *testing.T, name string, opts ...loadBytesOpts)

Source from the content-addressed store, hash-verified

24// LoadBytes is helper to load file contents relative to current (where test file is) package
25// directory.
26func LoadBytes(t *testing.T, name string, opts ...loadBytesOpts) []byte {
27 bytes := loadBytes(t, name, 2)
28
29 for _, f := range opts {
30 bytes = f(bytes)
31 }
32
33 return bytes
34}
35
36func loadBytes(t *testing.T, name string, callDepth int) []byte {
37 _, b, _, _ := runtime.Caller(callDepth)

Callers 7

TestToContext_JSONBodyFunction · 0.92
TestLoadBytesOKFunction · 0.92
TestLoadBytes_customFunction · 0.92
TestToContext_JSONBodyFunction · 0.85
TestLoadBytesOKFunction · 0.85

Calls 1

loadBytesFunction · 0.85

Tested by 7

TestToContext_JSONBodyFunction · 0.74
TestLoadBytesOKFunction · 0.74
TestLoadBytes_customFunction · 0.74
TestToContext_JSONBodyFunction · 0.68
TestLoadBytesOKFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…