Skip to content

Commit

Permalink
fix: fix slice init length
Browse files Browse the repository at this point in the history
  • Loading branch information
cuishuang authored Oct 4, 2024
1 parent dab4bde commit 97f1857
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/smokescreen/metrics/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (m *MockMetricsClient) GetCount(metric string, tags map[string]string) (uin
}
i, ok := m.counts[mName]
if !ok {
keys := make([]string, len(m.counts))
keys := make([]string, 0, len(m.counts))
for k, _ := range m.counts {
keys = append(keys, k)
}
Expand All @@ -92,7 +92,7 @@ func (m *MockMetricsClient) GetValues(metric string, tags map[string]string) ([]
}
i, ok := m.values[mName]
if !ok {
keys := make([]string, len(m.counts))
keys := make([]string, 0, len(m.counts))
for k, _ := range m.values {
keys = append(keys, k)
}
Expand Down

0 comments on commit 97f1857

Please sign in to comment.