code linting

This commit is contained in:
0xdcarns
2021-10-08 15:07:12 -04:00
parent a892595f78
commit d7cafbbc4c
49 changed files with 439 additions and 215 deletions
+5 -5
View File
@@ -6,14 +6,16 @@ import (
"os"
"path/filepath"
_ "github.com/mattn/go-sqlite3"
_ "github.com/mattn/go-sqlite3" // need to blank import this package
)
// == sqlite ==
const dbFilename = "netmaker.db"
// SqliteDB is the db object fro sqlite database connections
var SqliteDB *sql.DB
// SQLITE_FUNCTIONS - contains a map of the functions for sqlite
var SQLITE_FUNCTIONS = map[string]interface{}{
INIT_DB: initSqliteDB,
CREATE_TABLE: sqliteCreateTable,
@@ -67,9 +69,8 @@ func sqliteInsert(key string, value string, tableName string) error {
return err
}
return nil
} else {
return errors.New("invalid insert " + key + " : " + value)
}
return errors.New("invalid insert " + key + " : " + value)
}
func sqliteInsertPeer(key string, value string) error {
@@ -79,9 +80,8 @@ func sqliteInsertPeer(key string, value string) error {
return err
}
return nil
} else {
return errors.New("invalid peer insert " + key + " : " + value)
}
return errors.New("invalid peer insert " + key + " : " + value)
}
func sqliteDeleteRecord(tableName string, key string) error {