MCPcopy
hub / github.com/valyala/quicktemplate / readFile

Function readFile

parser/util.go:82–96  ·  view source on GitHub ↗
(cwd, filename string)

Source from the content-addressed store, hash-verified

80}
81
82func readFile(cwd, filename string) ([]byte, error) {
83 if len(filename) == 0 {
84 return nil, errors.New("filename cannot be empty")
85 }
86 if filename[0] != '/' {
87 cwdAbs, err := filepath.Abs(cwd)
88 if err != nil {
89 return nil, err
90 }
91 dir, _ := filepath.Split(cwdAbs)
92 filename = filepath.Join(dir, filename)
93 }
94
95 return ioutil.ReadFile(filename)
96}

Callers 1

parseCatMethod · 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…