preslavrachev / preslav.me-comments

0 stars 0 forks source link

2021/09/04/generic-golang-pipelines/ #21

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Generic Go Pipelines · Preslav Rachev

I am a software engineer with a decade-long experience developing software using Java, Go, and Elixir.

https://preslav.me/2021/09/04/generic-golang-pipelines/

aphsa commented 1 year ago

Why are you passing InputOutput twice ('p' and the function argument InputOutput)? is it possible to simplify that?

gowikel commented 1 year ago

@aphsa, the first InputOutput, p, is the function parameter, the second, is the return of the function.

So, the function receives just one InputOutput, and returns another one and an error, which will be nil if everything goes well.

gowikel commented 1 year ago

TBH, I wish this were more idiomatic in Go because it simplifies it when you have several operations applied to some data.