Go Locking Pitfall


Can you see (and explain) the issue with the following (slightly contrived) code? package main import ( "fmt" "sync" ) type Example struct { m sync.RWMutex a int } func (e *Example) ReadA() int { defer e.m.RUnlock() e.m.RLock() return e.a } func (e *Example) WorkWithA() int { defer e.m.RUnlock() e.m.RLock() val := e.ReadA() val += 1 return val } func (e *Example) UpdateA(newA int) { defer e.…
Read more ⟶

Tweaking Oxygenos on Oneplus 10 Pro


I recently picked up a OnePlus 10 pro. It seems to be one of the most feature-rich modern phones on the market right now. It has loads of memory and should receive updates until 2026 so although the price is rather steep, I should be good for at least 4 years, unlike the Pixel 3a XL that I purchased 2 years ago which is already no longer receiving updates and which is continuously running out of storage memory.…
Read more ⟶

Building a Generic Cache With Go 1.18


At GUTS we have a “hack day” each month. During this day the devteam deviates from the regular story board and people work individually or in teams on interesting, somewhat related projects and experiments or experiment with new frameworks or languages. My recent project was to build a generics based cache to replace all the custom, ad-hoc memory caches we currently have with all the quirky type assertions. The implementation is pretty straightforward - generics work and behave as you expect and the end result is a nice usable generic cache…
Read more ⟶