You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Second is problematic, because Begin returns Transaction (not *Transaction).
I have written this library a long time ago, when I was little experience with Go, especially with many subtle things like this. Avoid double reference looked reasonable but now I prefer return pointer, even if struct contains only on pointer field. Much benefit of avoid double reference disappeared when Go started (Go 1.5?) to always store pointer to value in interface, even if value is of pointer size.
Can't change Begin without break many applications. Maybe invalidate Transaction.Conn can be workaround...
This function:
I believe
c.my = nil
doesn't do anything, sinceconn
is not a pointer - it gets copied when you call Close(). You can fix this by running:I found this by running go-staticcheck on the codebase: https://github.com/dominikh/go-staticcheck
The text was updated successfully, but these errors were encountered: