File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020package main
2121
2222import (
23+ "syscall"
24+
2325 "github.com/spf13/cobra"
2426
2527 "github.com/onflow/flow-cli/internal/accounts"
@@ -129,4 +131,10 @@ func main() {
129131 if err := cmd .Execute (); err != nil {
130132 util .Exit (1 , err .Error ())
131133 }
134+
135+ // We are using a syscall because there is some dependency related to
136+ // connecting to the network that is not being closed properly. This
137+ // issue appeared with Go 1.23.1, but was not present in Go 1.22.
138+ // It looks like this may be GRPC related from the stack trace.
139+ syscall .Exit (command .StatusCode )
132140}
Original file line number Diff line number Diff line change @@ -89,6 +89,8 @@ const (
8989 logLevelNone = "none"
9090)
9191
92+ var StatusCode = 0
93+
9294// AddToParent add new command to main parent cmd
9395// and initializes all necessary things as well as take care of errors and output
9496// here we can do all boilerplate code that is else copied in each command and make sure
@@ -171,7 +173,8 @@ func (c Command) AddToParent(parent *cobra.Command) {
171173 if res , ok := result .(ResultWithExitCode ); ok {
172174 exitCode = res .ExitCode ()
173175 }
174- os .Exit (exitCode )
176+
177+ StatusCode = exitCode
175178 }
176179
177180 bindFlags (c )
You can’t perform that action at this time.
0 commit comments