mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-21 17:07:18 +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 {
|
||||
~int | ~string <1>
|
||||
~int | ~string
|
||||
}
|
||||
|
||||
func getKeysWithConstraing[K customConstraint, V any](m map[K]V) []K {
|
||||
|
|
@ -65,4 +65,4 @@ func main() {
|
|||
}
|
||||
sort.Sort(s)
|
||||
fmt.Println(s.S)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,4 +77,6 @@ func listing5() {
|
|||
defer mutex.Unlock()
|
||||
i = 2
|
||||
}()
|
||||
|
||||
_ = i
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import (
|
|||
|
||||
func TestCache_TrimBefore(t *testing.T) {
|
||||
events := []Event{
|
||||
{Timestamp: time.Now().Add(-20 * time.Millisecond)},
|
||||
{Timestamp: time.Now().Add(-10 * time.Millisecond)},
|
||||
{Timestamp: time.Now().Add(10 * time.Millisecond)},
|
||||
{Timestamp: parseTime(t, "2020-01-01T12:00:00.04Z")},
|
||||
{Timestamp: parseTime(t, "2020-01-01T12:00:00.05Z")},
|
||||
{Timestamp: parseTime(t, "2020-01-01T12:00:00.06Z")},
|
||||
}
|
||||
cache := &Cache{}
|
||||
cache.Add(events)
|
||||
|
|
|
|||
Loading…
Reference in a new issue