Lint
continuous-integration/drone/push Build is failing Details

master
Андрей Иванов 2024-09-10 12:58:51 +03:00
parent 9006e24af5
commit 23b53d352e
4 changed files with 5 additions and 4 deletions

View File

@ -97,6 +97,7 @@ linters:
- goerr113
- nonamedreturns
- staticcheck
- depguard
fast: false
issues:

View File

@ -2,7 +2,7 @@ PROJECT_NAME=modules
.PHONY: 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 ./...
.PHONY: test

View File

@ -109,12 +109,12 @@ func DialDSN(dsn string) (db *sql.DB, dbname string, err error) {
}
// 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()
res := make(map[string]string)
var key, val string
//TODO: Перенести это в параметры.
// TODO: Перенести это в параметры.
table := "config"
q := "SELECT " + table + ".key, " + table + ".value FROM " + table
results, err := database.Query(q)

2
go.mod
View File

@ -1,6 +1,6 @@
module git.tiburon.su/OCTOPUS/modules
go 1.22.0
go 1.22
require (
github.com/BurntSushi/toml v1.4.0