MCPcopy Create free account
hub / github.com/cloudwan/gohan / RunFile

Method RunFile

extension/gohanscript/vm.go:56–70  ·  view source on GitHub ↗

RunFile load data from file and execute it

(file string)

Source from the content-addressed store, hash-verified

54
55//RunFile load data from file and execute it
56func (vm *VM) RunFile(file string) (interface{}, error) {
57 code, err := LoadYAMLFile(file)
58 if err != nil {
59 return nil, err
60 }
61 main, err := NewStmt(file, code)
62 if err != nil {
63 return nil, err
64 }
65 runner, err := main.Func()
66 if err != nil {
67 return nil, err
68 }
69 return runner(vm.Context)
70}
71
72//LoadFile loads gohan script code from file and make func
73func (vm *VM) LoadFile(file string) error {

Callers 2

getRunCommandFunction · 0.95
RunTestsFunction · 0.95

Calls 3

FuncMethod · 0.95
LoadYAMLFileFunction · 0.85
NewStmtFunction · 0.85

Tested by

no test coverage detected