fix: lint and unclosed prepared stmt

This commit is contained in:
Richard Ramos 2022-05-27 14:34:13 -04:00
parent 0c989d3d8c
commit 56c8ef705a
2 changed files with 9 additions and 2 deletions

View File

@ -23,8 +23,6 @@ func genRandomTimestamp(now int64, last30d int64) int64 {
return rand.Int63n(last30d) + now
}
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
func genRandomContentTopic(n int) string {
topics := []string{"topic1", "topic2", "topic3", "topic4", "topic5"}
i := n % 5
@ -70,6 +68,10 @@ func main() {
fmt.Println("Inserting ", N, " records in ", dbName)
db, err := newdb(dbName)
if err != nil {
panic(err)
}
query := "INSERT INTO message (id, receiverTimestamp, senderTimestamp, contentTopic, pubsubTopic, payload, version) VALUES (?, ?, ?, ?, ?, ?, ?)"
err = createTable(db)

View File

@ -158,6 +158,11 @@ func (d *DBStore) Put(cursor *pb.Index, pubsubTopic string, message *pb.WakuMess
return err
}
err = stmt.Close()
if err != nil {
return err
}
return nil
}