jesseduffield / lazygit-debian

Debian package for lazygit
Other
14 stars 0 forks source link

Packaging github.com/jesseduffield/generics [#] #34

Open jmkim opened 1 year ago

jmkim commented 1 year ago

go test errors with x/exp.

jmkim commented 1 year ago

x/exp v0.0.0-20230905200255-921286631fa9 (latest):

# github.com/jesseduffield/generics/slices [github.com/jesseduffield/generics/slices.test]
./delegated_sort.go:18:21: type func(a E, b E) bool of less does not match inferred type func(a E, b E) int for func(a E, b E) int
./delegated_sort.go:24:27: type func(a E, b E) bool of less does not match inferred type func(a E, b E) int for func(a E, b E) int
./delegated_sort.go:35:32: type func(a E, b E) bool of less does not match inferred type func(a E, b E) int for func(a E, b E) int
./delegated_sort.go:44:9: too many return values
    have (int, bool)
    want (int)
./delegated_sort.go:56:9: too many return values
    have (int, bool)
    want (int)
./delegated_sort.go:56:36: not enough arguments in call to slices.BinarySearchFunc
    have ([]E, func(E) bool)
    want (S, T, func(E, T) int)
FAIL    github.com/jesseduffield/generics/slices [build failed]
jmkim commented 1 year ago

x/exp v0.0.0-20230711023510-fffb14384f22 (near the current Debian latest, which is already old):

# github.com/jesseduffield/generics/slices [github.com/jesseduffield/generics/slices.test]
./delegated_sort.go:44:9: too many return values
    have (int, bool)
    want (int)
./delegated_sort.go:56:9: too many return values
    have (int, bool)
    want (int)
./delegated_sort.go:56:36: not enough arguments in call to slices.BinarySearchFunc
    have ([]E, func(E) bool)
    want ([]E, T, func(E, T) int)
FAIL    github.com/jesseduffield/generics/slices [build failed]
jesseduffield commented 1 year ago

That generics package was intended to add extra functionality that the stdlib package didn't have. It provides wrappers over existing functions so that it can be used as a replacement for the stdlib package. But if you look in lazygit we're now only using the generics package for the sake of the maps and set sub-packages. So we can just remove the slices part of that package if it fixes these issues.

jmkim commented 1 year ago

Thanks @jesseduffield \o/

In Debian, this package will be used only by lazygit, at this time. I am going to remove slices part for now.