joao-r-reis commented on code in PR #1889: URL: https://github.com/apache/cassandra-gocql-driver/pull/1889#discussion_r2113653105
########## session.go: ########## @@ -454,6 +454,10 @@ func (s *Session) Bind(stmt string, b func(q *QueryInfo) ([]interface{}, error)) // Close closes all connections. The session is unusable after this // operation. func (s *Session) Close() { + // Closing a nil session is a non-event, return. + if s == nil { Review Comment: Do you have some kind of reference for this being considered the norm in Go libraries? Granted I don't have a lot of experience in the Go land but in all my time reading code from common Go libraries I've rarely seen libraries guard against `nil` receivers -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org