update revive to use defaults and friendly formatter
This commit is contained in:
parent
5e4e253f58
commit
aaeb303558
25
.revive.toml
25
.revive.toml
|
@ -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]
|
2
Makefile
2
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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)"`
|
||||
|
|
Loading…
Reference in New Issue