MCPcopy Index your code
hub / github.com/subtrace/subtrace / CopyFrom

Method CopyFrom

event/event.go:37–56  ·  view source on GitHub ↗

CopyFrom copies all tags from src except "time" and "event_id". If a key already exists in dst, it will be overwritten.

(src *Event)

Source from the content-addressed store, hash-verified

35// CopyFrom copies all tags from src except "time" and "event_id". If a key
36// already exists in dst, it will be overwritten.
37func (dst *Event) CopyFrom(src *Event) {
38 if src == nil {
39 return
40 }
41
42 src.mu.RLock()
43 defer src.mu.RUnlock()
44
45 dst.mu.Lock()
46 defer dst.mu.Unlock()
47
48 for _, key := range src.keys {
49 switch key {
50 case "time":
51 case "event_id":
52 default:
53 dst.setLocked(key, src.vals[key])
54 }
55 }
56}
57
58func (ev *Event) Set(key string, val string) {
59 ev.mu.Lock()

Callers 3

FinishMethod · 0.45
SetLocalTagsAsyncFunction · 0.45
CopyMethod · 0.45

Calls 2

setLockedMethod · 0.95
LockMethod · 0.80

Tested by

no test coverage detected