Skip to content

Commit

Permalink
Do not use pointer receiver for Close()
Browse files Browse the repository at this point in the history
A mix of pointer/non-pointer receivers makes it impossible to use interfaces
  • Loading branch information
gm42 committed May 9, 2024
1 parent a9635d8 commit ae773d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindings/go/src/fdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type DatabaseOptions struct {

// Close will close the Database and clean up all resources.
// You have to ensure that you're not resuing this database.
func (d *Database) Close() {
func (d Database) Close() {
// Remove database object from the cached databases
if d.isCached {
openDatabases.Delete(d.clusterFile)
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/src/fdb/fdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func createDatabase(clusterFile string) (Database, error) {
db := &database{outdb}
runtime.SetFinalizer(db, (*database).destroy)

return Database{clusterFile, true, db}, nil
return Database{clusterFile: clusterFile, isCached: true, database: db}, nil
}

// OpenWithConnectionString returns a database handle to the FoundationDB cluster identified
Expand Down

0 comments on commit ae773d9

Please sign in to comment.