diff --git a/.golangci.yml b/.golangci.yml index 746273a..22d2518 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -97,6 +97,7 @@ linters: - goerr113 - nonamedreturns - staticcheck + - depguard fast: false issues: diff --git a/Makefile b/Makefile index 7e5e1be..6decd40 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/core/config/config.go b/core/config/config.go index 2f1673c..061420e 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -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) diff --git a/go.mod b/go.mod index 99b394d..30fd7b2 100644 --- a/go.mod +++ b/go.mod @@ -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