Category Archives: Go
The challenge of type asserting []interface{} to string slices.
- Posted by Michael MacDonald
- on Nov, 12, 2019
- in Go
- Blog No Comments.
When working with JSON data it can be easy to silently miss converting data, if one is not doing the typical unmarshalling into a well defined struct but instead into a generic map[string]interface{}. Given the following data block: We can unmarshal it via If we then try and extract the data element and convert it […]
Read MoreSerializing/Deserializing a complex GO struct to store externally (i.e. in a database, redis, or text file)
- Posted by Michael MacDonald
- on May, 19, 2018
- in Go
- Blog No Comments.
Sometimes one needs to serialize data to store outside of a go application. One common approach is to save it as a JSON blob which can have it’s own challenges when retrieving it. In this article I will show you how to make use of GOB to serialize a complex struct into textual data than […]
Read MoreFun with golang, Google Maps api, and proxying requests
- Posted by Michael MacDonald
- on Aug, 31, 2017
- in Go
- Blog No Comments.
I admire published api code that is thoroughly thought through. Recently I have been working with the Google Maps API in golang and have found that they set it up to allow one to pass in an net/http/client variable which means that it is possible to create a http client which sends the requests via […]
Read MoreRecent Posts
- The shape of structured data
- Writing very small executable
- The challenge of type asserting []interface{} to string slices.
- Serializing/Deserializing a complex GO struct to store externally (i.e. in a database, redis, or text file)
- Fun with golang, Google Maps api, and proxying requests