Refactor parts of the code and add more tests

This is a refactor of parts of the code, some minor things such as adding
punctuation in the end of sentences and making the code a bit easier to read.

More tests has been added in the form of gometalinter which checks the code
health, style and spelling errors. The flaky cleanup test should also be fixed
with this commit.
This commit is contained in:
Anton Lindstrom
2016-07-21 19:48:29 +00:00
parent 3d07ee7804
commit d42994de5c
6 changed files with 83 additions and 56 deletions

View File

@@ -38,11 +38,11 @@ func (db *PGStore) cleanup(interval time.Duration, quit <-chan struct{}, done ch
for {
select {
case <-quit:
// Handle the quit signal
// Handle the quit signal.
done <- struct{}{}
return
case <-ticker.C:
// Delete expired sessions on each tick
// Delete expired sessions on each tick.
err := db.deleteExpired()
if err != nil {
log.Printf("pgstore: unable to delete expired sessions: %v", err)