Variable creates a new StatementGenerator representing a VariableGen.
(name string, child StatementGenerator)
| 273 | |
| 274 | // Variable creates a new StatementGenerator representing a VariableGen. |
| 275 | func Variable(name string, child StatementGenerator) *VariableGen { |
| 276 | if child != nil { |
| 277 | return &VariableGen{ |
| 278 | name: name, |
| 279 | options: child.Copy(), |
| 280 | } |
| 281 | } else { |
| 282 | return &VariableGen{ |
| 283 | name: name, |
| 284 | options: nil, |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // AddChildren implements the interface StatementGenerator. |
| 290 | func (v *VariableGen) AddChildren(children ...StatementGenerator) error { |
no test coverage detected