Return an empty array instead of null with golang for json return with gin September 17, 2023 by Tarik So the solution was to initialize it with : productConstructed.BrandMedals = make([]string, 0)