diff options
author | Max Magorsch <arzano@gentoo.org> | 2020-03-21 13:18:48 +0100 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2020-03-21 13:18:48 +0100 |
commit | 8e12081ad77663937063721fa7cd9193b7c8e483 (patch) | |
tree | 8f9f34b0e1c1322174daf080e5d66bd6b8fc654a /pkg/database/connection.go | |
parent | Correctly delete packages and versions when they are removed (diff) | |
download | soko-8e12081ad77663937063721fa7cd9193b7c8e483.tar.gz soko-8e12081ad77663937063721fa7cd9193b7c8e483.tar.bz2 soko-8e12081ad77663937063721fa7cd9193b7c8e483.zip |
Format the project using gofmt
Signed-off-by: Max Magorsch <arzano@gentoo.org>
Diffstat (limited to 'pkg/database/connection.go')
-rw-r--r-- | pkg/database/connection.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pkg/database/connection.go b/pkg/database/connection.go index e978007..ffedf4b 100644 --- a/pkg/database/connection.go +++ b/pkg/database/connection.go @@ -21,14 +21,14 @@ var ( // in case they don't alreay exist func CreateSchema() error { for _, model := range []interface{}{(*models.Package)(nil), - (*models.Category)(nil), - (*models.Version)(nil), - (*models.Commit)(nil), - (*models.KeywordChange)(nil), - (*models.CommitToPackage)(nil), - (*models.CommitToVersion)(nil), - (*models.Useflag)(nil), - (*models.Application)(nil)} { + (*models.Category)(nil), + (*models.Version)(nil), + (*models.Commit)(nil), + (*models.KeywordChange)(nil), + (*models.CommitToPackage)(nil), + (*models.CommitToVersion)(nil), + (*models.Useflag)(nil), + (*models.Application)(nil)} { err := DBCon.CreateTable(model, &orm.CreateTableOptions{ IfNotExists: true, @@ -41,7 +41,7 @@ func CreateSchema() error { return nil } -type dbLogger struct { } +type dbLogger struct{} func (d dbLogger) BeforeQuery(c context.Context, q *pg.QueryEvent) (context.Context, error) { return c, nil @@ -60,10 +60,10 @@ func Connect() { User: config.PostgresUser(), Password: config.PostgresPass(), Database: config.PostgresDb(), - Addr: config.PostgresHost() + ":" + config.PostgresPort(), + Addr: config.PostgresHost() + ":" + config.PostgresPort(), }) - if(config.Debug() == "true"){ + if config.Debug() == "true" { DBCon.AddQueryHook(dbLogger{}) } |