MCPcopy Create free account
hub / github.com/cogentcore/core / TranspileCodeFromFile

Method TranspileCodeFromFile

shell/shell.go:309–316  ·  view source on GitHub ↗

TranspileCodeFromFile transpiles the code in given file

(file string)

Source from the content-addressed store, hash-verified

307
308// TranspileCodeFromFile transpiles the code in given file
309func (sh *Shell) TranspileCodeFromFile(file string) error {
310 b, err := os.ReadFile(file)
311 if err != nil {
312 return err
313 }
314 sh.TranspileCode(string(b))
315 return nil
316}
317
318// TranspileFile transpiles the given input cosh file to the given output Go file,
319// adding package main and func main declarations.

Callers 2

SourceMethod · 0.95
TranspileFileMethod · 0.95

Calls 2

TranspileCodeMethod · 0.95
ReadFileMethod · 0.80

Tested by

no test coverage detected