-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix panic when started without a stdout (#549)
- Loading branch information
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/temporalio/cli | ||
|
||
go 1.21 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/alitto/pond v1.8.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/temporalio/cli/temporalcli/internal/printer" | ||
) | ||
|
||
// This main function is used to test that the printer package don't panic if | ||
// the CLI is run without a STDOUT. This is a tricky thing to validate, as it | ||
// must be done in a subprocess and as `go test` has its own internal fix for | ||
// improper STDOUT. This was fixed in Go 1.22, but keeping this here as a | ||
// regression test. See https://github.com/temporalio/cli/issues/544. | ||
func main() { | ||
p := &printer.Printer{ | ||
Output: os.Stdout, | ||
JSON: false, | ||
} | ||
p.Println("Test writing to stdout using Printer") | ||
os.Exit(0) | ||
} |