Open headwinds opened 1 year ago
hi @headwinds
I made a small PR: #230
Can you review it, please?
As soon as we are ok with this first PR, we can distribute work ;)
@samber I've reviewed & much approve - that's an excellent approach and should encourage more devs to contribute examples!
Can I ask you to write some examples for find.go ? I will keep pushing for slice.go and map.go.
I liked the example you provided above, but don't spend too much time with such big samples! ;)
I gonna write some instructions to future contributors in a PR template.
I just added:
cool I'll take a look at your samples and could write one similar for find.go - keep it small simple - 😘
or maybe not so simple but I always look for examples that have both a simple string and an object
Can I suggest some changes ?
-> https://go.dev/play/p/c2lDl0vxr-V
ok
In your last snippet, I'm not sure declaring ProductSearchResult
is necessary. It makes the example longer to understand. You can just return (Product, error)
instead.
@samber Yes this is great - let's go with your version - I'm pretty new to go and can see the experience in your upgrades!
Actually one small change - can we flip the function names and order - so that string example runs first then the struct example - simple before complex
Currently it prints:
We also found the product Dragon Fruit ($3.75)
We found the coconut
So I'd like to read:
We found the coconut
We also found the product Dragon Fruit ($3.75)
And ship it!
Yes, no worries ;)
Examples need to be clear and simple to read. This is the only requirement ;)
Still a few examples missing:
first off, fantastic library! this is more praise and wanting to help myself and others learn than an issue.
Has anyone already started to build a collection of examples using the go playground? The docs are excellent - a working example would be icing.
I was struggling a bit to learn how to use filter against a collection so created this playground to sort it out.