Remove the Gorp dependency
Removed the underlying Gorp package as a dependency & replaced with use of the standard database/sql driver. This removes a dependency and makes this package very lightweight and makes database interactions very transparent. Lastly, from the standpoint of unit testing where you want to mock the database layer instead of requiring a real database, you can now easily use a package like [go-SQLMock](https://github.com/DATA-DOG/go-sqlmock) to do just that. The tests may/not pass for Golang 1.5; it appears that the problem is Travis need to install a linter.
This commit is contained in:
@@ -53,6 +53,6 @@ func (db *PGStore) cleanup(interval time.Duration, quit <-chan struct{}, done ch
|
||||
|
||||
// deleteExpired deletes expired sessions from the database.
|
||||
func (db *PGStore) deleteExpired() error {
|
||||
_, err := db.DbMap.Exec("DELETE FROM http_sessions WHERE expires_on < now()")
|
||||
_, err := db.DbPool.Exec("DELETE FROM http_sessions WHERE expires_on < now()")
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user