mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-25 02:46:53 +08:00
Fixing typos
This commit is contained in:
parent
727ecfbc94
commit
58d014a963
3 changed files with 7 additions and 5 deletions
|
|
@ -31,7 +31,7 @@ func getKeysGenerics[K comparable, V any](m map[K]V) []K {
|
||||||
}
|
}
|
||||||
|
|
||||||
type customConstraint interface {
|
type customConstraint interface {
|
||||||
~int | ~string <1>
|
~int | ~string
|
||||||
}
|
}
|
||||||
|
|
||||||
func getKeysWithConstraing[K customConstraint, V any](m map[K]V) []K {
|
func getKeysWithConstraing[K customConstraint, V any](m map[K]V) []K {
|
||||||
|
|
|
||||||
|
|
@ -77,4 +77,6 @@ func listing5() {
|
||||||
defer mutex.Unlock()
|
defer mutex.Unlock()
|
||||||
i = 2
|
i = 2
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
_ = i
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ import (
|
||||||
|
|
||||||
func TestCache_TrimBefore(t *testing.T) {
|
func TestCache_TrimBefore(t *testing.T) {
|
||||||
events := []Event{
|
events := []Event{
|
||||||
{Timestamp: time.Now().Add(-20 * time.Millisecond)},
|
{Timestamp: parseTime(t, "2020-01-01T12:00:00.04Z")},
|
||||||
{Timestamp: time.Now().Add(-10 * time.Millisecond)},
|
{Timestamp: parseTime(t, "2020-01-01T12:00:00.05Z")},
|
||||||
{Timestamp: time.Now().Add(10 * time.Millisecond)},
|
{Timestamp: parseTime(t, "2020-01-01T12:00:00.06Z")},
|
||||||
}
|
}
|
||||||
cache := &Cache{}
|
cache := &Cache{}
|
||||||
cache.Add(events)
|
cache.Add(events)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue