Post #687713
2026-02-18 15:30 UTC
TIL that generics in Go can be used to access public variables in private structs.
https://go.dev/play/p/crusKHkTLhg
#GoLang
Replies (1)
-
@orsinium@fosstodon.org 2026-02-18 17:43
@bmitch@fosstodon.org you can also access public fields in private structs with reflection. in particular, this allows the json package to work with private structs.