Skip to content

Commit

Permalink
Also panic in the other syncmap function on failed type assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
eljobe committed Nov 12, 2024
1 parent b51dcfd commit 86b6cf0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions util/containers/syncmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ func (m *SyncMap[K, V]) Load(key K) (V, bool) {
}
vVal, ok := val.(V)
if !ok {
var empty V
return empty, false
panic(fmt.Sprintf("type assertion failed on %s", val))
}
return vVal, true
}
Expand Down

0 comments on commit 86b6cf0

Please sign in to comment.