You might find this proposal and the upcoming runtime/secret package interesting.
https://github.com/golang/go/issues/21865