add comment on creating a global DB variable

//Pls note that it's "=" rather than ":="
DB, err = gorm.Open("postgres", "user=gorm dbname=gorm sslmode=disable")
This commit is contained in:
Guan Ce 2014-07-13 17:05:04 +08:00
parent dee9520d4e
commit e0a7c13ef5

View File

@ -141,6 +141,7 @@ import (
var DB gorm.DB var DB gorm.DB
func init() { func init() {
var err error var err error
//Pls note that it's "=" rather than ":="
DB, err = gorm.Open("postgres", "user=gorm dbname=gorm sslmode=disable") DB, err = gorm.Open("postgres", "user=gorm dbname=gorm sslmode=disable")
// Connection string parameters for Postgres - http://godoc.org/github.com/lib/pq, if you are using another // Connection string parameters for Postgres - http://godoc.org/github.com/lib/pq, if you are using another