February 17, 2021
Removing null values from maps or JSON with Go
Recently I was given a task of removing all keys that have null values from an arbirtrary json. We do data processing of Excel/csv files and have default config generated for them server-side. Users provide custom configuration (column types, names, headers, sorting …) and these two get merged. Problem was - if key existed and had null value it would override the key that had a value. Obviously there may be other ways to do this, but this is a very generic solution that can be used in most cases.
Read more