Skip to content

Commit 97e0c69

Browse files
committed
Fix method name, new go version 1.20
1 parent 5c241c7 commit 97e0c69

File tree

3 files changed

+234
-251
lines changed

3 files changed

+234
-251
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/mowshon/moviego
22

3-
go 1.18
3+
go 1.20
44

55
require (
66
github.com/tidwall/gjson v1.14.0

helpers.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
package moviego
22

33
type Ordered interface {
4-
int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr | float32 | float64 | string
4+
int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | uintptr | float32 | float64 | string
55
}
66

77
func InArray[T Ordered](needle T, haystack []T) bool {
8-
for _, val := range haystack {
9-
if val == needle {
10-
return true
11-
}
12-
}
13-
return false
8+
for _, val := range haystack {
9+
if val == needle {
10+
return true
11+
}
12+
}
13+
return false
1414
}
1515

1616
func Keys[M ~map[K]V, K comparable, V any](m M) []K {
17-
r := make([]K, 0, len(m))
18-
for k := range m {
19-
r = append(r, k)
20-
}
21-
return r
17+
r := make([]K, 0, len(m))
18+
for k := range m {
19+
r = append(r, k)
20+
}
21+
return r
2222
}

0 commit comments

Comments
 (0)