fix slice initialization to avoid nil pointer dereference

This commit is contained in:
pascal
2026-08-03 21:51:48 +02:00
parent 2c85d94c6c
commit 07d0440e34

View File

@@ -152,7 +152,7 @@ func toMap[T any](all []T, id func(t T) string) map[string]*T {
}
func toSliceOfPtrs[T any](all []T) []*T {
toret := make([]*T, len(all))
toret := make([]*T, 0, len(all))
for _, t := range all {
toret = append(toret, &t)
}