We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f629ce1 commit 2b20187Copy full SHA for 2b20187
internal/provider/cisco/gnmiext/v2/list.go
@@ -81,10 +81,8 @@ func (l *List[K, V]) UnmarshalJSON(data []byte) error {
81
return fmt.Errorf("failed to unmarshal list: %w", err)
82
}
83
84
- // Initialize the map if needed
85
- if *l == nil {
86
- *l = make(List[K, V], len(slice))
87
- }
+ // Initialize the map to an empty map with the appropriate capacity
+ *l = make(List[K, V], len(slice))
88
89
// Convert slice to map using the Key() method
90
for _, item := range slice {
0 commit comments