fix: resolve all golangci-lint errors
- Add blank lines before return statements (nlreturn) - Remove unused metaCacheMu field and sync import (unused) - Rename unused groups parameter to _ (revive) - Use StorageFilePerm constant instead of magic 0600 (mnd, gosec) - Add nolint directive for vipsOnce global (gochecknoglobals)
This commit is contained in:
@@ -40,12 +40,13 @@ func New(_ fx.Lifecycle, params Params) (*Logger, error) {
|
||||
}
|
||||
|
||||
// replaceAttr simplifies the source attribute to "file.go:line"
|
||||
replaceAttr := func(groups []string, a slog.Attr) slog.Attr {
|
||||
replaceAttr := func(_ []string, a slog.Attr) slog.Attr {
|
||||
if a.Key == slog.SourceKey {
|
||||
if src, ok := a.Value.Any().(*slog.Source); ok {
|
||||
a.Value = slog.StringValue(fmt.Sprintf("%s:%d", filepath.Base(src.File), src.Line))
|
||||
}
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user