diff --git a/Gopkg.lock b/Gopkg.lock index 8430a9deb..247f62011 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -93,7 +93,7 @@ ".", "resputil" ] - revision = "48ba0357b31ad368f66fa2441bd23c12757c56a0" + revision = "382da457432419256cfbcf8806efcc1470adb60f" [[projects]] branch = "master" diff --git a/vendor/github.com/titpetric/factory/database.go b/vendor/github.com/titpetric/factory/database.go index d4869a76d..d688d2438 100644 --- a/vendor/github.com/titpetric/factory/database.go +++ b/vendor/github.com/titpetric/factory/database.go @@ -131,6 +131,15 @@ func (r *DatabaseFactory) Get(dbName ...string) (*DB, error) { return nil, fmt.Errorf("No configuration found for database: %v", names) } +// MustGet is the same as Get, except it will panic on connection error +func (r *DatabaseFactory) MustGet(dbName ...string) *DB { + db, err := r.Get(dbName...) + if err != nil { + panic(err) + } + return db +} + // DB struct encapsulates sqlx.DB to add new functions type DB struct { *sqlx.DB