How would the go equivalent look like
>>109775501You tell me, I never used go
>>109775501You could have asked AI but instead you wasted your time.
>>109775766No, he wasted YOUR time, and we're laughing about it.
>>109775501result, err := users.Where(func(user User) bool { return user.Score > 50}).Order().Reverse().Skip(2)
result, err := users.Where(func(user User) bool { return user.Score > 50}).Order().Reverse().Skip(2)
>>109776061N-no please, that doesn't fit with the narrative I was going with! Please delete your post!
>>109775910nice try OP
>>109775501I love LINQ
>>109776061Nice try, but original lambda obviously did not return boolI assume it's operator overloading into some sort of sql statement type
```goimport ( "cmp" "slices")result := slices.Clone(users)result = slices.DeleteFunc(result, func(u User) bool { return u.Score <= 50 })slices.SortFunc(result, func(a, b User) int { return cmp.Compare(b.Score, a.Score) })if len(result) > 2 { result = result[2:]} else { result = result[:0]}```
>>109778843fuck are you talking about, in what world does user => user.Score > 50 not return a bool in js? .Where obviously takes a filter func, and filter funcs work by returning a bool on each indice. .Where returns a slice, on which you could use .Sort. the rest (.Reverse, .Skip) are abstracted away because theyre trivial to implement, even though they dont exist in the go std or on those types. the same vibe is completely applicable though.
user => user.Score > 50
.Reverse, .Skip
>>109775501>.Order()order by what?
>>109776061>>109779434>even though they dont exist in the go stdso, you mean that code that you wrote doesn’t actually work out of the box?>theyre trivial to implementthen why the fuck aren’t they already implemented out of the box?Not implementing inheritance in golang was based, but the disdain for common syntax sugar is autistic
>>109779946>then why the fuck aren’t they already implemented out of the box?Because adding dumb features just so you can jump on every passing fad is how you get C++.
sorry for wasting your time I figured it out
>>109779434>jsI thought that's c#.Still boolean.
>>109779957I though gotards were creaming themselves over having a "batteries-included" stdlib unlike eg rust, what happened?
>>109779434What JS, this is fucking C#
>>109775501what abomination is this
>>109778728Last word hahahaha