Hacker Newsnew | past | comments | ask | show | jobs | submit | ryanlschneider's commentslogin

That was going to be my suggestion too. With the added benefit that is supports multiple arguments.


Speaking of the .Get method, wouldn't returning an error alongside the value instead of just the default object be more idiomatic?


I think it would be nice to return a bool, rather than an error. It really is just a binary condition and this pattern fits nicely with accessing values in maps. That said, I haven't really found a need for a .Get method in my own code, and will probably just stick with encoding/json for the time being.


It looks like .Get uses the null pattern (ie, returns a Jason struct with data = `nil` if nothing is found). Your way is more idiomatic, but it looks like his point with this library is to access the data conveniently in exchange for type-safety. `exists()` can verify something was found if needed.


Fun! When I saw the title, I was expecting the opposite: a normal cross word with the usual "42 Across (4): It gets things done" style hints, but the answers were valid regex's. Someone make that too!


Regular crossword entries (that only have letters in them) are already valid regexen.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: