From bca1b0ccdece7b992cc88712aca36a9a127b1381 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sun, 25 May 2025 09:31:58 +0100 Subject: Use modern APIs and retire MapKeys --- util.go | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'util.go') diff --git a/util.go b/util.go index 47a785a..ec2a3dd 100644 --- a/util.go +++ b/util.go @@ -3,20 +3,6 @@ package core -// MapKeys returns a slice containing all the keys of the map supplied. -// It basically is https://pkg.go.dev/golang.org/x/exp/maps#Keys, but -// that package is still unstable. -func MapKeys[T ~map[K]V, K comparable, V any](m T) []K { - if len(m) == 0 { - return nil - } - ret := make([]K, 0, len(m)) - for k := range m { - ret = append(ret, k) - } - return ret -} - // Must panics if err is not nil. It returns val otherwise. func Must[T any](val T, err error) T { if err != nil { -- cgit v1.2.3-70-g09d2