Commits


Mark Wolfe authored and GitHub committed 15ee52111b5
GH-36696: [Go] Improve the MapOf and ListOf helpers (#36697) ### Rationale for this change The aim is to improve the MapOf and ListOf helper functions without breaking anything. I have added a `ListOfWithName` which matches the `MapOf` function in that it takes a name, rather than deriving it from the elements name, which should actually be `element`. This just seems clearer to me as an interface, and makes construction a bit more obvious. ### What changes are included in this PR? * Removed references to panics I can't find * Updated error messages for list and map to be clearer with validation errors * Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name Closes #36696 ### Are these changes tested? Yes, I added a test for the new `ListOfWithName` function. ### Are there any user-facing changes? * Closes: #36696 Authored-by: Mark Wolfe <mark@wolfe.id.au> Signed-off-by: Matt Topol <zotthewizard@gmail.com>