Replace prazdnikisegodnyaru with celebratoday, small underhood fixes

- Replace prazdnikisegodnyaru with celebratoday as first is banned in Russia
- Update .golangci.yml rule set
- Megatons of fixes for linter
- Update README.md
This commit is contained in:
eleksir
2026-02-10 20:05:13 +03:00
parent ff57b0af7d
commit f2fc168abe
28 changed files with 1298 additions and 268 deletions

View File

@@ -1,3 +1,4 @@
// Package log implements logging facility as golang slog module wrapper.
package log
import (
@@ -33,9 +34,9 @@ func Init(level string, fileDescriptor *os.File) {
opts := &slog.HandlerOptions{
// Use the ReplaceAttr function on the handler options
// to be able to replace any single attribute in the log output
// to be able to replace any single attribute in the log output.
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr { //nolint: revive
// check that we are handling the time key
// Check that we are handling the time key.
if a.Key != slog.TimeKey {
return a
}
@@ -62,7 +63,7 @@ func Init(level string, fileDescriptor *os.File) {
)
}
// Error passes message directly to slog.Error().
// Error passes message directly to [slog.Error()].
func Error(message string) {
slog.Error(message)
}
@@ -72,7 +73,7 @@ func Errorf(format string, a ...any) {
slog.Error(fmt.Sprintf(format, a...))
}
// Warn passes message directly to slog.Warn().
// Warn passes message directly to [slog.Warn()].
func Warn(message string) {
slog.Warn(message)
}
@@ -82,7 +83,7 @@ func Warnf(format string, a ...any) {
slog.Warn(fmt.Sprintf(format, a...))
}
// Info passes message directly to slog.Info().
// Info passes message directly to [slog.Info()].
func Info(message string) {
slog.Info(message)
}
@@ -92,7 +93,7 @@ func Infof(format string, a ...any) {
slog.Info(fmt.Sprintf(format, a...))
}
// Debug passes message directly to slog.Debug().
// Debug passes message directly to [slog.Debug()].
func Debug(message string) {
slog.Debug(message)
}