Better golang equivalent that converts to JSON