MCPcopy
hub / github.com/valyala/quicktemplate / validateCaseStmt

Function validateCaseStmt

parser/parser.go:876–880  ·  view source on GitHub ↗
(switchValue string, stmt []byte)

Source from the content-addressed store, hash-verified

874}
875
876func validateCaseStmt(switchValue string, stmt []byte) error {
877 exprStr := fmt.Sprintf("func () { switch %s {case %s:} }", switchValue, stmt)
878 _, err := goparser.ParseExpr(exprStr)
879 return err
880}
881
882func validateFuncCode(code []byte) error {
883 exprStr := fmt.Sprintf("func () { for { %s\n } }", code)

Callers 1

parseCaseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…