I should have RTFMed, but even there, the nil display issue is not highlighted :) Thanks. It seemed odd that there wasn't already a way. It might be good to highlight this feature in the right places. I'm not sure if
golangdocs.com is the official easy on-ramp for golang but if so, at
https://golangdocs.com/string-formatting-in-golang 's section 1.5 the wording "print the Go-representation of the struct." could read "... the struct, and explicitly show <nil> valued slices and maps."; and the example could show this case.
The same applies to the official documentation for the fmt package, which states (in the comments of one example): " // The %#v form (the # is called a "flag" in this context) shows the map in
// the Go source format. Maps are printed in a consistent order, sorted" without reference to how nils are treated.
In addition, I would argue that the unadorned %v documentation should mention that nil values are folded into the "empty" representation.
Anyway, as time allows I'll find the doc source and submit PRs implementing the above suggestions.
Thank you for pointing this solution out.
Andrew