MCPcopy Create free account
hub / github.com/gokcehan/lf / readFile

Method readFile

app.go:98–117  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

96}
97
98func (app *app) readFile(path string) {
99 log.Printf("reading file: %s", path)
100
101 f, err := os.Open(path)
102 if err != nil {
103 app.ui.echoerrf("opening file: %s", err)
104 return
105 }
106 defer f.Close()
107
108 p := newParser(f)
109
110 for p.parse() {
111 p.expr.eval(app, nil)
112 }
113
114 if p.err != nil {
115 app.ui.echoerrf("%s", p.err)
116 }
117}
118
119func loadFiles() (clipboard clipboard, err error) {
120 files, err := os.Open(gFilesPath)

Callers 2

loopMethod · 0.95
evalMethod · 0.80

Calls 4

newParserFunction · 0.85
echoerrfMethod · 0.80
parseMethod · 0.80
evalMethod · 0.65

Tested by

no test coverage detected