-
-
Notifications
You must be signed in to change notification settings - Fork 897
Closed
Description
package main
import (
"fmt"
"github.com/samber/lo"
)
type intSlice []int
func main() {
s1 := intSlice{3, 4, 5}
s2 := lo.Filter(s1, func(_ int, _ int) bool { return true })
i1 := any(s2)
s3 := i1.(intSlice)
fmt.Printf("s3: %#v", s3)
}
^^ The above panics because s2 is of type []int
, not intSlice
.
Filter()
seems like it should return intSlice
here instead.
wesdotcool
Metadata
Metadata
Assignees
Labels
No labels