small improvement on Go snippet