Improve interfaces and fix more linter errors

This commit is contained in:
Daniel 2020-09-24 09:50:38 +02:00
parent 5bb73a7b4c
commit 362539692e
11 changed files with 55 additions and 69 deletions

View file

@ -2,15 +2,22 @@
package hashmap
import (
"context"
"reflect"
"sync"
"testing"
"github.com/safing/portbase/database/storage"
"github.com/safing/portbase/database/query"
"github.com/safing/portbase/database/record"
)
var (
// Compile time interface checks.
_ storage.Interface = &HashMap{}
_ storage.Batcher = &HashMap{}
)
type TestRecord struct {
record.Base
sync.Mutex
@ -130,16 +137,6 @@ func TestHashMap(t *testing.T) {
t.Fatal("should fail")
}
// maintenance
err = db.Maintain(context.TODO())
if err != nil {
t.Fatal(err)
}
err = db.MaintainThorough(context.TODO())
if err != nil {
t.Fatal(err)
}
// shutdown
err = db.Shutdown()
if err != nil {