When adds "WHEN ... THEN ..." part to CASE construct
(when interface{}, then interface{})
| 117 | |
| 118 | // When adds "WHEN ... THEN ..." part to CASE construct |
| 119 | func (b CaseBuilder) When(when interface{}, then interface{}) CaseBuilder { |
| 120 | // TODO: performance hint: replace slice of WhenPart with just slice of parts |
| 121 | // where even indices of the slice belong to "when"s and odd indices belong to "then"s |
| 122 | return builder.Append(b, "WhenParts", newWhenPart(when, then)).(CaseBuilder) |
| 123 | } |
| 124 | |
| 125 | // What sets optional "ELSE ..." part for CASE construct |
| 126 | func (b CaseBuilder) Else(expr interface{}) CaseBuilder { |