Elegant way to deal with Go lack of static local variables