From aaeb303558d212274d2a45a2b2c950d8a57d0a67 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 7 Nov 2019 12:57:50 -0800 Subject: [PATCH] update revive to use defaults and friendly formatter --- .revive.toml | 25 ------------------------- Makefile | 2 +- models/db.go | 4 ++-- models/merp.go | 2 +- 4 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 .revive.toml diff --git a/.revive.toml b/.revive.toml deleted file mode 100644 index 74743d5..0000000 --- a/.revive.toml +++ /dev/null @@ -1,25 +0,0 @@ -ignoreGeneratedHeader = false -severity = "warning" -confidence = 0.8 -errorCode = 1 -warningCode = 1 - -[rule.blank-imports] -[rule.context-as-argument] -[rule.context-keys-type] -[rule.dot-imports] -[rule.error-return] -[rule.error-strings] -[rule.error-naming] -[rule.exported] -[rule.if-return] -[rule.increment-decrement] -[rule.var-naming] -[rule.var-declaration] -[rule.package-comments] -[rule.range] -[rule.receiver-naming] -[rule.time-naming] -[rule.unexported-return] -[rule.indent-error-flow] -[rule.errorf] diff --git a/Makefile b/Makefile index 744f9fc..a693ba5 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ fmt: lint: go get -u github.com/mgechev/revive - revive -config .revive.toml -exclude=./vendor/... ./... || exit 1 + revive -formatter friendly -exclude=./vendor/... ./... || exit 1 test: build-docker-image diff --git a/models/db.go b/models/db.go index b128ffe..3e5d619 100644 --- a/models/db.go +++ b/models/db.go @@ -22,10 +22,10 @@ func connectToDb() { orm.DefaultTimeLoc = time.UTC - POSTGRES_DB_URL := os.Getenv("POSTGRES_DB_URL") + dbURL := os.Getenv("POSTGRES_DB_URL") orm.RegisterDriver("postgres", orm.DRPostgres) - orm.RegisterDataBase("default", "postgres", POSTGRES_DB_URL) + orm.RegisterDataBase("default", "postgres", dbURL) orm.SetMaxIdleConns("default", 1) orm.SetMaxOpenConns("default", 5) diff --git a/models/merp.go b/models/merp.go index b64d478..95b4122 100644 --- a/models/merp.go +++ b/models/merp.go @@ -2,7 +2,7 @@ package models import "time" -// Merps are the primary database item in merp +// Merp is the data model for storing merps in the db type Merp struct { ID int `orm:"auto;column(id)"` Content string `json:"content" orm:"type(jsonb);column(content)"`