Variable collisions; Possible use of nil value (#256)
* Variable '*' collides with imported package name * Variable 'error' collides with builtin interface * '*' may have 'nil' or other unexpected value as its corresponding error variable may be not 'nil'
This commit is contained in:
@@ -50,6 +50,9 @@ func createTable(db *sql.DB) {
|
||||
|
||||
func addMessage(message models.ChatMessage) {
|
||||
tx, err := _db.Begin()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
stmt, err := tx.Prepare("INSERT INTO messages(id, author, body, messageType, visible, timestamp) values(?, ?, ?, ?, ?, ?)")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user