We had a discussion today about JSON parsing in our golang app. We had some code like this:

// lenient parsing will ignore unrecognized propertiesvar user User
err = json.Unmarshal([]byte(jsonString), &user)
assert.Nil(t, err)

The goal was to verify that has the correct contents that matched the type…

Mike Kowdley

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store