From e25efd2c62175e82b364c0344d77c882aa951f68 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Tue, 4 Aug 2026 14:04:26 +0200 Subject: [PATCH] common/mclock: rename symbol to remove conflicts with other languages (#35460) Calling a function `do` is fine in go, but when interacting with other languages, namely C, this clashes with a known keyword, which some compilers don't like. --- common/mclock/simclock.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/mclock/simclock.go b/common/mclock/simclock.go index f5ad3f8bc0..accf95c0ff 100644 --- a/common/mclock/simclock.go +++ b/common/mclock/simclock.go @@ -43,7 +43,7 @@ type simTimer struct { at AbsTime index int // position in s.scheduled s *Simulated - do func() + run func() ch <-chan AbsTime } @@ -62,7 +62,7 @@ func (s *Simulated) Run(d time.Duration) { var do []func() for len(s.scheduled) > 0 && s.scheduled[0].at <= end { ev := heap.Pop(&s.scheduled).(*simTimer) - do = append(do, ev.do) + do = append(do, ev.run) } s.now = end s.mu.Unlock() @@ -135,7 +135,7 @@ func (s *Simulated) schedule(d time.Duration, fn func()) *simTimer { s.init() at := s.now.Add(d) - ev := &simTimer{do: fn, at: at, s: s} + ev := &simTimer{run: fn, at: at, s: s} heap.Push(&s.scheduled, ev) s.cond.Broadcast() return ev