From 520708bb4a46896e7912aa009e19c5aecbe0cfe1 Mon Sep 17 00:00:00 2001 From: otherview Date: Wed, 13 Sep 2023 17:04:08 +0100 Subject: [PATCH] lint --- tools/walletextension/storage/database/sqlite.go | 8 ++++++-- tools/walletextension/storage/storage_test.go | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/walletextension/storage/database/sqlite.go b/tools/walletextension/storage/database/sqlite.go index 9dff865f60..1c9cddbec8 100644 --- a/tools/walletextension/storage/database/sqlite.go +++ b/tools/walletextension/storage/database/sqlite.go @@ -3,11 +3,12 @@ package database import ( "database/sql" "fmt" - obscurocommon "github.com/obscuronet/go-obscuro/go/common" - "github.com/obscuronet/go-obscuro/go/common/errutil" "os" "path/filepath" + obscurocommon "github.com/obscuronet/go-obscuro/go/common" + "github.com/obscuronet/go-obscuro/go/common/errutil" + _ "github.com/mattn/go-sqlite3" // sqlite driver for sql.Open() common "github.com/obscuronet/go-obscuro/tools/walletextension/common" ) @@ -19,6 +20,9 @@ type SqliteDatabase struct { func NewSqliteDatabase(dbPath string) (*SqliteDatabase, error) { // load the db file dbFilePath, err := createOrLoad(dbPath) + if err != nil { + return nil, err + } // open the db db, err := sql.Open("sqlite3", dbFilePath) diff --git a/tools/walletextension/storage/storage_test.go b/tools/walletextension/storage/storage_test.go index 10ef81fec5..63d27846f8 100644 --- a/tools/walletextension/storage/storage_test.go +++ b/tools/walletextension/storage/storage_test.go @@ -3,9 +3,10 @@ package storage import ( "bytes" "errors" + "testing" + "github.com/obscuronet/go-obscuro/go/common/errutil" "github.com/stretchr/testify/require" - "testing" ) var tests = map[string]func(storage Storage, t *testing.T){