Unmarshal JSON With Multiple Roots In Go

Elliot Chance
1 min readOct 5, 2018

--

Photo by Jeremy Bishop on Unsplash

If you need to handle JSON strings or streams that have multiple JSON roots the Go library does come with this functionality, but it not easily accessible. It takes a bit of fiddling with reflect.

Here is my drop-in version:

Originally published at http://elliot.land on October 5, 2018.

--

--

Elliot Chance
Elliot Chance

Written by Elliot Chance

I’m a data nerd and TDD enthusiast originally from Sydney. Currently working for Uber in New York. My thoughts here are my own. 🤓 elliotchance@gmail.com

No responses yet