CreateArray creates an Array to be used with the *Event.Array method. It preserves the stack, hooks, and context from the parent event. Call usual field methods like Str, Int etc to add elements to this array and give it as argument the *Event.Array method.
()
| 214 | // Call usual field methods like Str, Int etc to add elements to this |
| 215 | // array and give it as argument the *Event.Array method. |
| 216 | func (e *Event) CreateArray() *Array { |
| 217 | a := Arr() |
| 218 | if e != nil { |
| 219 | a.stack = e.stack |
| 220 | a.ctx = e.ctx |
| 221 | a.ch = e.ch |
| 222 | } |
| 223 | return a |
| 224 | } |
| 225 | |
| 226 | // Array adds the field key with an array to the event context. |
| 227 | // Use e.CreateArray() to create the array or pass a type that |