PDPaul Di Gianinpauldigian.com·Nov 26, 2022 · 4 min readWhy software is difficultAfter having worked in different organization with different levels of maturity, and different backgrounds I mature some opinion on why software is difficult. But the answer is difficult and messy, and nobody like it. People don't scale One solid tec...00
PDPaul Di Gianinpauldigian.com·Nov 21, 2021 · 8 min readAdvanced go - Avoiding `if` for initialization using `sync.Once` and foot guns to watch out forWe already discussed when to use constructors and when let the user of your library initialize their structures. The short version is that if the structure makes sense and can be used as zero value, or with some fields unset. Or, in other words, if ...01B
PDPaul Di Gianinpauldigian.com·Nov 12, 2021 · 12 min readGolang and context - an explanationThe Golang standard library comes with a simple interface, context.Context, which is a little harder to understand and use than the others. The difficulties in getting the context.Context interface may be the naming, maybe not super appropriate. In t...01S
PDPaul Di Gianinpauldigian.com·Nov 7, 2021 · 3 min readAdvanced go - Make synchronous code asynchronous with context.Context and channelsGo standard library comes with a nice little structure that allows to stop long-running goroutines, when theirs result is not needed anymore: context.Context. If any of the call you are making, has the potential to block for a long amount of time, it...00
PDPaul Di Gianinpauldigian.com·Nov 4, 2021 · 3 min readAdvanced go - Choosing between a constructor and declaring the typeIn go there are two ways to create structures. Either you instantiate the structure directly, populate its fields. Or you use a constructor, that will populate the structure fields. Suppose we have a structure: type Foo struct { Fuz int Bar [...00