Tackling the Problem With the String Values and the Struct
Some of you may be familiar with the problem of binding string values, such as those from a POST request or URL query parameter in the form of url.Values and there are some (good) libraries that have been developed specifically for this purpose, for example the quite popular go-playground/form package.
My problem with such libraries is that they are usually based on reflection – which can be slow and is generally unpopular for good reasons – and that you need to have a little secret esoteric knowledge in your head to avoid mishandling niche cases or, if necessary, write your own handlers to convert data to the correct data type.