LoadBytes is helper to load file contents relative to current (where test file is) package directory.
(t *testing.T, name string, opts ...loadBytesOpts)
| 24 | // LoadBytes is helper to load file contents relative to current (where test file is) package |
| 25 | // directory. |
| 26 | func 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 | |
| 36 | func loadBytes(t *testing.T, name string, callDepth int) []byte { |
| 37 | _, b, _, _ := runtime.Caller(callDepth) |
searching dependent graphs…