mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
chore: update golangci-lint and fix all issues (#3575)
* chore: Update golangci-lint Signed-off-by: Lars Francke <git@lars-francke.de> * chore: fix all golangci-lint issues - Remove deprecated `// +build` tags - Fix godoclint, modernize, wsl_v5, govet, lll, gci, noctx issues - Update linter configuration - Modernize code to use Go 1.22+ features (for range N, slices.Contains, etc.) - Update make check lint the privileged tests Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> --------- Signed-off-by: Lars Francke <git@lars-francke.de> Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com> Co-authored-by: Lars Francke <git@lars-francke.de>
This commit is contained in:
+4
-4
@@ -162,14 +162,14 @@ func (e *Event) Err(err error) *Event {
|
||||
}
|
||||
|
||||
// Interface adds any interface field to the event.
|
||||
func (e *Event) Interface(key string, val interface{}) *Event {
|
||||
func (e *Event) Interface(key string, val any) *Event {
|
||||
e.attrs = append(e.attrs, slog.Any(key, val))
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
// Any adds any interface field to the event (alias for Interface).
|
||||
func (e *Event) Any(key string, val interface{}) *Event {
|
||||
func (e *Event) Any(key string, val any) *Event {
|
||||
return e.Interface(key, val)
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ func (e *Event) Strs(key string, vals []string) *Event {
|
||||
}
|
||||
|
||||
// IPAddr adds an IP address field to the event.
|
||||
func (e *Event) IPAddr(key string, ip interface{}) *Event {
|
||||
func (e *Event) IPAddr(key string, ip any) *Event {
|
||||
e.attrs = append(e.attrs, slog.String(key, fmt.Sprintf("%v", ip)))
|
||||
|
||||
return e
|
||||
@@ -214,7 +214,7 @@ func NewTestLoggerPtr() *Logger {
|
||||
}
|
||||
|
||||
// Msgf logs the event with a formatted message.
|
||||
func (e *Event) Msgf(format string, args ...interface{}) {
|
||||
func (e *Event) Msgf(format string, args ...any) {
|
||||
msg := fmt.Sprintf(format, args...)
|
||||
|
||||
// Create a new slice to avoid modifying the original
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//go:build sync && scrub && metrics && search
|
||||
// +build sync,scrub,metrics,search
|
||||
|
||||
package log_test
|
||||
|
||||
|
||||
Reference in New Issue
Block a user