AddOrAppendMetaSlice puts the provided string into the slice if the key doesn't exist or appends the string to the slice.
(k MetadataKey, s string)
| 258 | // AddOrAppendMetaSlice puts the provided string into the slice if the key |
| 259 | // doesn't exist or appends the string to the slice. |
| 260 | func (e *Event) AddOrAppendMetaSlice(k MetadataKey, s string) { |
| 261 | if e.ContainsMeta(k) { |
| 262 | v := append(e.GetMeta(k).([]string), s) |
| 263 | e.AddMeta(k, v) |
| 264 | } else { |
| 265 | e.AddMeta(k, []string{s}) |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | // RemoveMeta removes the event metadata index by given key. |
| 270 | func (e *Event) RemoveMeta(k MetadataKey) { |
no test coverage detected