Skip to content

Commit

Permalink
only close for test
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Mar 3, 2023
1 parent f04d4d9 commit 56bcfcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions xmain/xmain.go
Expand Up @@ -94,9 +94,6 @@ type State struct {
}

func (ms *State) Main(ctx context.Context, sigs <-chan os.Signal, run func(context.Context, *State) error) error {
defer ms.Stdout.Close()
defer ms.Stderr.Close()

ctx, cancel := context.WithCancel(ctx)
defer cancel()

Expand Down
2 changes: 2 additions & 0 deletions xmain/xmaintest.go
Expand Up @@ -122,6 +122,8 @@ func (ts *TestState) Start(tb testing.TB, ctx context.Context) {
go func() {
var err error
defer func() {
ts.ms.Stdout.Close()
ts.ms.Stderr.Close()
pipeWG.Wait()
if tempDirCleanup != nil {
tempDirCleanup()
Expand Down

0 comments on commit 56bcfcd

Please sign in to comment.