mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-04 19:45:14 -04:00
fix slice initialization to avoid nil pointer dereference
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user