mirror of
https://github.com/gravitational/teleport.git
synced 2026-11-01 21:52:02 +08:00
A new type constraint was added to the sort cache to make indexes type safe. The types are limited to `comparable` so the indexes can be used as map keys internally. The primary motivation for the change is to leverage the compiler to prevent using indexes which are not valid for a given cache. While it's still technically possible to use a string literal as the index if the type index is constrained to `~string` it should be avoided to ensure the compiler can catch invalid indexes.