From e8d35d7d2dbaa163e7aaa6819fc64d26ac112b98 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 17 Feb 2025 01:05:30 +0000 Subject: [PATCH 1/2] fix(deps): update module github.com/spf13/cobra to v1.9.1 --- go.mod | 4 ++-- go.sum | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 6859178fa..ca5f09ea7 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/jedib0t/go-pretty/v6 v6.6.6 github.com/lmittmann/tint v1.0.7 github.com/mattn/go-colorable v0.1.14 - github.com/spf13/cobra v1.8.1 + github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 github.com/spf13/viper v1.19.0 github.com/stackitcloud/stackit-sdk-go/core v0.15.1 @@ -54,7 +54,7 @@ require ( ) require ( - github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/danieljoos/wincred v1.2.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect diff --git a/go.sum b/go.sum index 242a895f2..7f9ccfe6a 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ al.essio.dev/pkg/shellescape v1.5.1 h1:86HrALUujYS/h+GtqoB26SBEdkWfmMI6FubjXlsXyho= al.essio.dev/pkg/shellescape v1.5.1/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890= -github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0= github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -111,9 +111,8 @@ github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= From a87613a33ef9cf2bc98f4cbdc594def817e35544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Schmitz?= <152157960+bahkauv70@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:26:44 +0100 Subject: [PATCH 2/2] fix deprecation warning --- internal/pkg/print/print_test.go | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/internal/pkg/print/print_test.go b/internal/pkg/print/print_test.go index 942689ce4..5c68dc2cf 100644 --- a/internal/pkg/print/print_test.go +++ b/internal/pkg/print/print_test.go @@ -57,7 +57,8 @@ func TestOutputf(t *testing.T) { t.Run(tt.description, func(t *testing.T) { var buf bytes.Buffer cmd := &cobra.Command{} - cmd.SetOutput(&buf) + cmd.SetOut(&buf) + cmd.SetErr(&buf) p := &Printer{ Cmd: cmd, Verbosity: tt.verbosity, @@ -128,7 +129,8 @@ func TestOutputln(t *testing.T) { t.Run(tt.description, func(t *testing.T) { var buf bytes.Buffer cmd := &cobra.Command{} - cmd.SetOutput(&buf) + cmd.SetOut(&buf) + cmd.SetErr(&buf) p := &Printer{ Cmd: cmd, Verbosity: tt.verbosity, @@ -192,7 +194,8 @@ func TestPagerDisplay(t *testing.T) { t.Run(tt.description, func(t *testing.T) { var buf bytes.Buffer cmd := &cobra.Command{} - cmd.SetOutput(&buf) + cmd.SetOut(&buf) + cmd.SetErr(&buf) p := &Printer{ Cmd: cmd, Verbosity: tt.verbosity, @@ -291,7 +294,8 @@ func TestDebug(t *testing.T) { t.Run(tt.description, func(t *testing.T) { var buf bytes.Buffer cmd := &cobra.Command{} - cmd.SetOutput(&buf) + cmd.SetOut(&buf) + cmd.SetErr(&buf) logger := slog.New(slog.NewTextHandler(&buf, &slog.HandlerOptions{AddSource: true, Level: slog.LevelDebug})) slog.SetDefault(logger) p := &Printer{ @@ -354,7 +358,8 @@ func TestInfo(t *testing.T) { t.Run(tt.description, func(t *testing.T) { var buf bytes.Buffer cmd := &cobra.Command{} - cmd.SetOutput(&buf) + cmd.SetOut(&buf) + cmd.SetErr(&buf) p := &Printer{ Cmd: cmd, Verbosity: tt.verbosity, @@ -413,7 +418,8 @@ func TestWarn(t *testing.T) { t.Run(tt.description, func(t *testing.T) { var buf bytes.Buffer cmd := &cobra.Command{} - cmd.SetOutput(&buf) + cmd.SetOut(&buf) + cmd.SetErr(&buf) p := &Printer{ Cmd: cmd, Verbosity: tt.verbosity, @@ -472,7 +478,8 @@ func TestError(t *testing.T) { t.Run(tt.description, func(t *testing.T) { var buf bytes.Buffer cmd := &cobra.Command{} - cmd.SetOutput(&buf) + cmd.SetOut(&buf) + cmd.SetErr(&buf) p := &Printer{ Cmd: cmd, Verbosity: tt.verbosity,