MCPcopy
hub / github.com/MadAppGang/dingo / writeBlockWithImplicitReturn

Method writeBlockWithImplicitReturn

pkg/codegen/lambda.go:162–168  ·  view source on GitHub ↗

writeBlockWithImplicitReturn writes a block body with return added. Transforms { expr } to { return expr }

()

Source from the content-addressed store, hash-verified

160// writeBlockWithImplicitReturn writes a block body with return added.
161// Transforms { expr } to { return expr }
162func (g *LambdaCodeGen) writeBlockWithImplicitReturn() {
163 body := g.expr.Body
164 inner := strings.TrimSpace(body[1 : len(body)-1])
165 g.Write("{ return ")
166 g.Write(inner)
167 g.Write(" }")
168}

Callers 1

generateBodyMethod · 0.95

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected