Make linter happy and move to os from io/ioutil for reading/writing.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-08-14 15:49:05 +05:00
parent df5671586e
commit 2ec0e28243
28 changed files with 99 additions and 99 deletions

View File

@@ -25,7 +25,6 @@
package context
import (
"io/ioutil"
"os"
"path/filepath"
@@ -100,11 +99,11 @@ func (c *Context) LoadConfiguration() {
c.Logger.Debug().Str("path", configPath).Msg("Configuration file path")
// nolint:exhaustruct
//nolint:exhaustruct
c.Config = &config.Struct{}
// Read configuration file.
fileData, err2 := ioutil.ReadFile(normalizedConfigPath)
fileData, err2 := os.ReadFile(normalizedConfigPath)
if err2 != nil {
c.Logger.Panic().Err(err2).Msg("Failed to read configuration file")
}

View File

@@ -31,6 +31,6 @@ const (
// New creates new context.
func New() *Context {
// nolint:exhaustruct
//nolint:exhaustruct
return &Context{}
}

View File

@@ -24,7 +24,7 @@ func (c *Context) getMemoryUsage(event *zerolog.Event, level zerolog.Level, mess
// Initializes logger.
func (c *Context) initializeLogger() {
// Устанавливаем форматирование логгера.
// nolint:exhaustruct
//nolint:exhaustruct
output := zerolog.ConsoleWriter{Out: os.Stdout, NoColor: false, TimeFormat: time.RFC3339}
output.FormatLevel = func(lvlRaw interface{}) string {
var lvl string