No need to sweat with unexported fields et al, you can just struct compose with context.Background(), no deadlines then look up using the target ctx 😎
I implemented this in 2018 for Go stdlib net.LookupIPAddr per github.com/golang/go/comm… fixing github.com/golang/go/issu… #golang
I'm not using it [ I swear ], but I wrote something to copy all of the values out of a context ignoring any deadlines.
I had to use a trick to read unexported fields from the standard library's context package. 🙈
go.dev/play/p/oeLiwuX…





