import ( ⏎ "time" ) func Throttle(fn func(), interval time.Duration) func() { var lastExecuted time.Time return func() { now := time.Now() if now.Sub(lastExecuted) >= interval { lastExecuted = now fn() } } }