Lint
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
9006e24af5
commit
23b53d352e
|
@ -97,6 +97,7 @@ linters:
|
||||||
- goerr113
|
- goerr113
|
||||||
- nonamedreturns
|
- nonamedreturns
|
||||||
- staticcheck
|
- staticcheck
|
||||||
|
- depguard
|
||||||
fast: false
|
fast: false
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -2,7 +2,7 @@ PROJECT_NAME=modules
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: ## Линт всего проекта
|
lint: ## Линт всего проекта
|
||||||
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.51.1
|
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.61.0
|
||||||
golangci-lint run --config=./.golangci.yml ./...
|
golangci-lint run --config=./.golangci.yml ./...
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
|
|
@ -109,12 +109,12 @@ func DialDSN(dsn string) (db *sql.DB, dbname string, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method adds and replace config fields from db.
|
// Method adds and replace config fields from db.
|
||||||
func (s Interface) SetFromDB(database *sql.DB, dbname string) error {
|
func (s Interface) SetFromDB(database *sql.DB, _ string) error {
|
||||||
defer database.Close()
|
defer database.Close()
|
||||||
res := make(map[string]string)
|
res := make(map[string]string)
|
||||||
var key, val string
|
var key, val string
|
||||||
|
|
||||||
//TODO: Перенести это в параметры.
|
// TODO: Перенести это в параметры.
|
||||||
table := "config"
|
table := "config"
|
||||||
q := "SELECT " + table + ".key, " + table + ".value FROM " + table
|
q := "SELECT " + table + ".key, " + table + ".value FROM " + table
|
||||||
results, err := database.Query(q)
|
results, err := database.Query(q)
|
||||||
|
|
Loading…
Reference in New Issue