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

Function returnCode

extension/gohanscript/stmtparser.go:146–155  ·  view source on GitHub ↗
(stmt *Stmt)

Source from the content-addressed store, hash-verified

144}
145
146func returnCode(stmt *Stmt) (func(*Context) (interface{}, error), error) {
147 retValue, err := NewValue(stmt.RawData["return"])
148 if err != nil {
149 return nil, err
150 }
151 return func(context *Context) (interface{}, error) {
152 val := retValue.Value(context)
153 return val, breakCode{}
154 }, nil
155}
156
157func fail(stmt *Stmt) (func(*Context) (interface{}, error), error) {
158 return func(context *Context) (interface{}, error) {

Callers

nothing calls this directly

Calls 2

ValueMethod · 0.95
NewValueFunction · 0.85

Tested by

no test coverage detected