I would like to design a "clone" connection function in my program, which takes a parent connection, and run pgx.ConnectConfig() with the same config of the parent connection, and also deep copy the type map of the parent connection.
However, I can't find a way to do such a deep copy, as none of Map.oidToType or nameToType and etc are exported.
So I wonder if we can implement a method like func (m *Map) Clone() Map, or just simply make these not-exported field accessible so that i can loop over entries inside each map.
I would like to design a "clone" connection function in my program, which takes a parent connection, and run
pgx.ConnectConfig()
with the same config of the parent connection, and also deep copy the type map of the parent connection.However, I can't find a way to do such a deep copy, as none of
Map.oidToType
ornameToType
and etc are exported.So I wonder if we can implement a method like
func (m *Map) Clone() Map
, or just simply make these not-exported field accessible so that i can loop over entries inside each map.