docs: fix (T, bool) return pattern documentation#51
Conversation
The documentation incorrectly stated that bool=true skips template execution. The actual behavior is bool=false skips template (you already handled it), bool=true continues to template execution.
Code Review - PR #51: Fix (T, bool) Return Pattern DocumentationSummary✅ APPROVED - This is an important documentation fix that corrects a critical inversion in the boolean return value semantics. Changes ReviewedThe PR corrects documentation in VerificationI verified this fix against the actual implementation in if basic, ok := lastResult.(*types.Basic); ok && basic.Kind() == types.Bool {
return []ast.Stmt{
// ...
&ast.AssignStmt{Lhs: []ast.Expr{dataVar, ast.NewIdent(okIdent)}, Tok: token.ASSIGN, Rhs: []ast.Expr{call}},
&ast.IfStmt{
Cond: &ast.UnaryExpr{Op: token.NOT, X: ast.NewIdent(okIdent)}, // if !ok
Body: &ast.BlockStmt{
List: []ast.Stmt{
&ast.ReturnStmt{}, // return early, skip template
},
},
},
// ... continues to set result and okay=true if ok was true
}, nil
}The logic clearly shows:
This is also confirmed by the test in
Code Quality Assessment✅ Correctness
✅ Consistency
✅ ClarityThe new wording is more intuitive:
ImpactThis is a documentation-only change with no code modifications, so there are no:
Additional NotesThe corrected documentation aligns well with the common Go pattern where a boolean return value indicates "success" or "should continue", making RecommendationApprove and merge. This fix corrects important user-facing documentation that could lead to significant confusion and bugs if left incorrect. 🤖 Generated with Claude Code |
The documentation incorrectly stated that bool=true skips template execution. The actual behavior is bool=false skips template (you already handled it), bool=true continues to template execution.