Fix linting issue and temporary removing logging in test acion

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
pull/30708/head
Benoit Tigeot 6 months ago
parent b42767be40
commit 15de13f9d2
No known key found for this signature in database
GPG Key ID: 8E6D4FC8AEBDA62C

@ -33,13 +33,13 @@ type Logger interface {
type NopLogger struct{}
// Debug implements Logger.Debug by doing nothing.
func (NopLogger) Debug(_ string, args ...any) {}
func (NopLogger) Debug(_ string, _ ...any) {}
// Warn implements Logger.Warn by doing nothing.
func (NopLogger) Warn(_ string, args ...any) {}
func (NopLogger) Warn(_ string, _ ...any) {}
// Error implements Logger.Error by doing nothing.
func (NopLogger) Error(_ string, args ...any) {}
func (NopLogger) Error(_ string, _ ...any) {}
// DefaultLogger provides a no-op logger that discards all messages.
// It can be used as a default when no logger is provided.

@ -59,7 +59,7 @@ func NewReadableTextLogger(output io.Writer, debugEnabled bool) Logger {
handler := slog.NewTextHandler(output, &slog.HandlerOptions{
Level: level,
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
ReplaceAttr: func(_ []string, a slog.Attr) slog.Attr {
if a.Key == slog.TimeKey {
return slog.Attr{}
}

@ -16,7 +16,6 @@ limitations under the License.
package action
import (
"flag"
"fmt"
"io"
"testing"
@ -35,8 +34,6 @@ import (
"helm.sh/helm/v4/pkg/time"
)
var verbose = flag.Bool("test.log", false, "enable test logging")
func actionConfigFixture(t *testing.T) *Configuration {
t.Helper()
@ -50,7 +47,7 @@ func actionConfigFixture(t *testing.T) *Configuration {
KubeClient: &kubefake.FailingKubeClient{PrintingKubeClient: kubefake.PrintingKubeClient{Out: io.Discard}},
Capabilities: chartutil.DefaultCapabilities,
RegistryClient: registryClient,
Log: logadapter.DefaultLogger,
Log: logadapter.DefaultLogger, // TODO: permit to log in test as before with `var verbose = flag.Bool("test.log", false, "enable test logging")``
}
}

Loading…
Cancel
Save