Created
May 22, 2017 11:14
-
-
Save timmow/984bb1b1fbea5878925d71a73a6bd225 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/postgres" | |
) | |
func main() { | |
fmt.Println("vim-go") | |
// Could use config/config.go Connect here | |
db, err := gorm.Open("postgres", "<redacted>") | |
if err != nil { | |
// return a 500 maybe make error more useful | |
fmt.Println("cant connect to db") | |
} | |
// maybe run a query | |
defer db.Close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment