mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-21 14:22:43 +02:00
RemoveExtra()
This commit is contained in:
parent
1c4a64d2a1
commit
c68e876b05
@ -8,6 +8,14 @@ func (evt *Event) SetExtra(key string, value any) {
|
||||
evt.extra[key] = value
|
||||
}
|
||||
|
||||
// RemoveExtra removes an out-of-the-spec value under the given key from the event object.
|
||||
func (evt *Event) RemoveExtra(key string) {
|
||||
if evt.extra == nil {
|
||||
return
|
||||
}
|
||||
delete(evt.extra, key)
|
||||
}
|
||||
|
||||
// GetExtra tries to get a value under the given key that may be present in the event object
|
||||
// but is hidden in the basic type since it is out of the spec.
|
||||
func (evt Event) GetExtra(key string) any {
|
||||
|
Loading…
x
Reference in New Issue
Block a user