aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/tick.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/engine/tick.go')
-rw-r--r--internal/engine/tick.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/engine/tick.go b/internal/engine/tick.go
index 68dd54f..8c64cdd 100644
--- a/internal/engine/tick.go
+++ b/internal/engine/tick.go
@@ -4,6 +4,7 @@ package engine
import (
"math/rand"
+ "reflect"
"sort"
"sync"
"time"
@@ -171,6 +172,16 @@ func ValuesEqual(a, b any) bool {
if aok && bok {
return ai == bi
}
+ // == panics when both operands share an uncomparable dynamic type (a
+ // YAML list or map used as a flag value). Fall back to DeepEqual so a
+ // tick system cannot panic on authored content.
+ ta, tb := reflect.TypeOf(a), reflect.TypeOf(b)
+ if ta != tb {
+ return false
+ }
+ if ta != nil && !ta.Comparable() {
+ return reflect.DeepEqual(a, b)
+ }
return a == b
}