From f7dac164c018fda0640d2858f2238528db25110e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 18:15:12 +0000 Subject: [PATCH 1/2] Bump github.com/rogpeppe/go-internal from 1.13.1 to 1.14.1 Bumps [github.com/rogpeppe/go-internal](https://github.com/rogpeppe/go-internal) from 1.13.1 to 1.14.1. - [Release notes](https://github.com/rogpeppe/go-internal/releases) - [Commits](https://github.com/rogpeppe/go-internal/compare/v1.13.1...v1.14.1) --- updated-dependencies: - dependency-name: github.com/rogpeppe/go-internal dependency-version: 1.14.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 32bea4870..eb12551c2 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/pkg/errors v0.9.1 github.com/pquerna/otp v1.5.0 - github.com/rogpeppe/go-internal v1.13.1 + github.com/rogpeppe/go-internal v1.14.1 github.com/slackhq/nebula v1.9.5 github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 github.com/smallstep/certificates v0.28.3 diff --git a/go.sum b/go.sum index 15e4a5b27..8ab893631 100644 --- a/go.sum +++ b/go.sum @@ -262,8 +262,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI= github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw= -github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= -github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= From 6a18ddaf61684ca14369ed962aadeccfc6e59665 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Wed, 25 Jun 2025 11:39:22 +0200 Subject: [PATCH 2/2] Fix deprecation of `testscript.RunMain` --- cmd/step/main.go | 4 +--- integration/shared_test.go | 5 ++--- internal/cmd/root.go | 10 +++++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cmd/step/main.go b/cmd/step/main.go index c2cbeee2c..8dc5e7b10 100644 --- a/cmd/step/main.go +++ b/cmd/step/main.go @@ -1,8 +1,6 @@ package main import ( - "os" - "github.com/smallstep/certificates/ca" "github.com/smallstep/cli-utils/step" @@ -27,5 +25,5 @@ func init() { } func main() { - os.Exit(cmd.Run()) + cmd.Run() } diff --git a/integration/shared_test.go b/integration/shared_test.go index 0985f5aba..ec9c20107 100644 --- a/integration/shared_test.go +++ b/integration/shared_test.go @@ -1,7 +1,6 @@ package integration import ( - "os" "testing" "github.com/rogpeppe/go-internal/testscript" @@ -10,7 +9,7 @@ import ( ) func TestMain(m *testing.M) { - os.Exit(testscript.RunMain(m, map[string]func() int{ + testscript.Main(m, map[string]func(){ "step": cmd.Run, // main entrypoint name - })) + }) } diff --git a/internal/cmd/root.go b/internal/cmd/root.go index 6e42c187a..aa1bb6df6 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -43,15 +43,19 @@ import ( _ "github.com/smallstep/cli/command/ssh" ) -func Run() int { +func Run() { + os.Exit(run()) +} + +func run() int { + defer panicHandler() + // initialize step environment. if err := step.Init(); err != nil { fmt.Fprintln(os.Stderr, err.Error()) return 1 } - defer panicHandler() - // create new instance of app app := newApp(os.Stdout, os.Stderr)