pulumi/sdk/go/common/util/cmdutil
Will Jones 1be4888f7d
Replace `result.Result` with native errors (#17044)
`result.Result` is a type that was introduced to enable us to
distinguish between *expected* errors (or *bails* in Pulumi parlance)
and *unexpected* errors or exceptions. Prior to Go 1.13, this made a lot
of sense, since there was no standard story on "wrapping" errors, and
thus no way to answer the question "did I end up here (in an error path)
because I meant to, or did I end up here because of a program bug?".

With the introduction of `%w`, `interface { Unwrap() []error }` and
company in Go 1.13, a simpler interface is available: one can use
`errors.Is` and `errors.As` to ask if an error at any point wraps an
error of a certain type. With this, we can simply ask "is there a bail
at any point in this error tree?" rather than having to track this
explicitly using a type such as `result.Result`. The `IsBail` function
was introduced a while ago to this end, but its rollout was not
completed and several uses of `result.Result` remained.

This commit completes the rollout of this simplified interface,
replacing all uses of `result.Result` with native Go errors that may or
may not wrap bails, and all uses of e.g. `res.IsBail` with
`IsBail(err)`. Doing so allows us to remove `result.Result` entirely.
2024-08-22 14:39:59 +00:00
..
testdata Fix TestTerminate_gracefulShutdown/python flake (#16471) 2024-06-26 05:50:58 +00:00
args.go Update golangci-lint (#14624) 2023-11-21 15:16:13 +00:00
child_js.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
child_unix.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
child_windows.go Revert "resource/plugin: Shut down plugins gracefully (#13795)" (#13844) 2023-08-31 16:29:55 +00:00
console.go New deployment settings wizards and environment variables management comands (#16564) 2024-07-03 20:24:26 +00:00
console_input.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
console_input_js.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
console_password.go cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815) 2023-08-30 17:08:44 +00:00
console_test.go cmdutil.ReadConsole[NoEcho]: Use bubbletea (#13815) 2023-08-30 17:08:44 +00:00
diag.go Remove Colorization.Auto (#15030) 2024-01-03 16:33:07 +00:00
exit.go Replace `result.Result` with native errors (#17044) 2024-08-22 14:39:59 +00:00
exit_test.go Clean up multi-error rendering (#17039) 2024-08-22 10:32:45 +00:00
profile.go [cli] Better memory profiling 2023-05-25 09:20:12 -07:00
spinner.go Add `--suppress-progresss` flag to CLI (#14690) 2024-02-05 11:48:10 +00:00
stack.go Support always qualifying stack names (#11081) (#15857) 2024-04-04 10:11:46 +00:00
term.go feat(cmdutil): TerminateProcessGroup for graceful termination (#13792) 2023-08-27 22:05:44 +00:00
term_js.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
term_test.go Fix TestTerminate_gracefulShutdown/python flake (#16471) 2024-06-26 05:50:58 +00:00
term_unix.go [display] Enable WASM compilation (#16246) 2024-05-24 20:27:56 +00:00
term_windows.go feat(cmdutil): TerminateProcessGroup for graceful termination (#13792) 2023-08-27 22:05:44 +00:00
trace.go Reimport appdash from our mirror (#14701) 2023-11-30 14:21:35 +00:00