Comment

Comment by devmop

It's ugly either way but for clarity you can move the error checks into the transformation leaving the call point clean.

i.e transform1 returns (result, error) and transform2 accepts (result, error) and short-circuits if err is not nil.

It allows the expressive and succinct description of a transformation list but with a bunch of messiness hidden.

parent devmop 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton