Silence all warnings of golint not related to missing comments.

This commit is contained in:
Sascha L. Teichmann
2016-04-24 12:41:58 +02:00
parent cf14aed031
commit ea57c7c35f
6 changed files with 40 additions and 38 deletions

View File

@ -15,10 +15,10 @@ import (
)
const (
createSql = "CREATE TABLE blocks (pos INT NOT NULL PRIMARY KEY, data BLOB)"
insertSql = "INSERT INTO blocks (pos, data) VALUES (?, ?)"
deleteSql = "DELETE FROM blocks"
selectSql = "SELECT pos, data FROM blocks"
createSQL = "CREATE TABLE blocks (pos INT NOT NULL PRIMARY KEY, data BLOB)"
insertSQL = "INSERT INTO blocks (pos, data) VALUES (?, ?)"
deleteSQL = "DELETE FROM blocks"
selectSQL = "SELECT pos, data FROM blocks"
)
var ErrDatabaseNotExists = errors.New("Database does not exists.")
@ -58,19 +58,19 @@ func NewSQLiteBlockConsumer(
}
if createNew {
if _, err = db.Exec(createSql); err != nil {
if _, err = db.Exec(createSQL); err != nil {
db.Close()
return
}
} else {
if _, err = db.Exec(deleteSql); err != nil {
if _, err = db.Exec(deleteSQL); err != nil {
db.Close()
return
}
}
var insertStmt *sql.Stmt
if insertStmt, err = db.Prepare(insertSql); err != nil {
if insertStmt, err = db.Prepare(insertSQL); err != nil {
db.Close()
return
}
@ -136,7 +136,7 @@ func NewSQLiteBlockProducer(
}
var rows *sql.Rows
if rows, err = db.Query(selectSql); err != nil {
if rows, err = db.Query(selectSQL); err != nil {
db.Close()
return
}

View File

@ -123,12 +123,12 @@ func NewSqliteBackend(
return
}
func (sb *SqliteBackend) buildCoverage() (err error) {
func (sqlb *SqliteBackend) buildCoverage() (err error) {
log.Println("INFO: Start building coverage index (this may take some time)...")
sb.coverage = common.NewCoverage3D()
sqlb.coverage = common.NewCoverage3D()
var rows *sql.Rows
if rows, err = sb.keysStmt.Query(); err != nil {
if rows, err = sqlb.keysStmt.Query(); err != nil {
return
}
defer rows.Close()
@ -138,7 +138,7 @@ func (sb *SqliteBackend) buildCoverage() (err error) {
if err = rows.Scan(&key); err != nil {
return
}
sb.coverage.Insert(common.PlainToCoord(key))
sqlb.coverage.Insert(common.PlainToCoord(key))
}
err = rows.Err()
log.Println("INFO: Finished building coverage index.")