google-cloud-go
google-cloud-go copied to clipboard
spanner: defers are executed at the end of func
Tracking issue for https://github.com/googleapis/google-cloud-go/pull/9759
Related https://github.com/googleapis/google-cloud-go/issues/9784
Currently there are quite a few tests that have a code along the lines of:
for _, test := range testcases {
client := NewClient(...)
defer client.Close()
This closing will happen at the end of the function, not at the end of the for loop.