add port in PostgreSQL connection example (#1652)

This commit is contained in:
PapEr 2018-01-31 17:09:24 +08:00 committed by Jinzhu
parent 04dd90a8da
commit 62721e0dda

View File

@ -44,7 +44,7 @@ import (
)
func main() {
db, err := gorm.Open("postgres", "host=myhost user=gorm dbname=gorm sslmode=disable password=mypassword")
db, err := gorm.Open("postgres", "host=myhost port=myport user=gorm dbname=gorm sslmode=disable password=mypassword")
defer db.Close()
}
```