4 ms·
>api.Res("users", resp).Id(1).Get() >What happens if the argument passed to api.Res is not "users"? Or "users" is incorrect? Or if Id 1 doesnt exist? Or you ca
by aksx 12y ago
>api.Res("users", resp).Id(1).Get()
>What happens if the argument passed to api.Res is not "users"? Or "users" is incorrect? Or if Id 1 doesnt exist? Or you cant use the HTTP method Get on the selected resource? Or if I want to use a HTTP method you haven't got a function for?
It is places like this where i would love to use railway oriented programming[1] or monads.
I love chaining function calls but can't do them without worrying about errors as you said, Someday i'll sit and try to implement Monads in Go
[1]http://fsharpforfunandprofit.com/posts/recipe-part2/ http://fsharpforfunandprofit.com/posts/recipe-part2/