Published inRandom Go tipsClosing closed channelsA Go channel cannot be closed twice, doing so will panic…Oct 4, 2016Oct 4, 2016
Published inRandom Go tipsDynamic JSON schemas in Go (part 1) : optional fieldsIt is sometimes necessary to work with JSON objects using a dynamic schema : optional fields, fields having dynamic types, …Oct 29, 2015Oct 29, 2015
Published inRandom Go tipsMethod overriding in Go[EDIT 10/30/2015 : rewrote most of the post for clarity and exactitude]Oct 26, 2015A response icon5Oct 26, 2015A response icon5
Published inRandom Go tipsJSON and zero dates in GoThe Go JSON encoder is great (easy to use and easy to extend), except for a tiny thing : zero times which marshal to “0001–01–01T00:00:00Z”…Oct 24, 2015A response icon1Oct 24, 2015A response icon1
Published inRandom Go tipsOn context.Context keys uniquenessAfter reading the blog post introducing context.Context, I got used to using integers as context.Context keys.Oct 14, 2015A response icon1Oct 14, 2015A response icon1
Published inRandom Go tipsinit() without init() in GoI like when files are as self-contained as possible, and having to put some init logic elsewhere (e.g. in a package-level init() function)…Oct 12, 2015A response icon1Oct 12, 2015A response icon1