Open devhawk opened 10 months ago
I agree this would be useful. This might be part of #1803. Otherwise, a new method could be added.
I see 3 options for that method.
I kind of lean toward the first option as it avoids any allocations.
Call back based iterator would also work (https://blog.kowalczyk.info/article/1Bkr/3-ways-to-iterate-in-go.html)
Yeah, an iterator would be possible. Though maybe overkill. Hmm... actually if that was done it would be best to use the new https://github.com/golang/go/issues/61405 Go iteration construct (though that would mean delaying the feature for at least a year).
Though I think I still lean toward exposing the map directly.
PgConn
struct has a privateparameterStatuses
map field. ThePgConn.ParameterStatus
method returns the value of a specified key from that map. As far as I can tell, there is no mechanism to retrieve the set of keys in the map.PgConn
should expose either a clone of theparameterStatuses
field (generated viamaps.Clone
maybe?) or an array of theparameterStatuses
keys that the caller can then use to call the existingParameterStatus
with.