From 23b53d352efa820604b22b37621db8eb7f214f78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=98=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Tue, 10 Sep 2024 12:58:51 +0300 Subject: [PATCH] Lint --- .golangci.yml | 1 + Makefile | 2 +- core/config/config.go | 4 ++-- go.mod | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) 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