From 79a91d75483d3ecb7a85d060749c98de38798129 Mon Sep 17 00:00:00 2001 From: Dan Hardman Date: Tue, 20 Sep 2016 16:55:01 +0100 Subject: [PATCH] Update CONTRIBUTING.md executable script template Change `db` to type `*gorm.DB` to reflect latest version of gorm. Remove re-declarations of `db, err` --- CONTRIBUTING.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c54d572d..52dbd8b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,26 +27,26 @@ package main import ( - _ "github.com/mattn/go-sqlite3" - _ "github.com/go-sql-driver/mysql" - _ "github.com/lib/pq" - "github.com/jinzhu/gorm" + _ "github.com/go-sql-driver/mysql" + "github.com/jinzhu/gorm" + _ "github.com/lib/pq" + _ "github.com/mattn/go-sqlite3" ) -var db gorm.DB +var db *gorm.DB func init() { - var err error - db, err = gorm.Open("sqlite3", "test.db") - // db, err := gorm.Open("postgres", "user=username dbname=password sslmode=disable") - // db, err := gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True") - if err != nil { - panic(err) - } - db.LogMode(true) + var err error + db, err = gorm.Open("sqlite3", "test.db") + // db, err = gorm.Open("postgres", "user=username dbname=password sslmode=disable") + // db, err = gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True") + if err != nil { + panic(err) + } + db.LogMode(true) } func main() { - // Your code + // Your code } ```