You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pkg/tool/exec: show command arguments in errors as a Go slice
If we render the command arguments as a quoted Go string joining
the arguments via spaces, it's always going to be confusing if any
of those arguments contain any spaces.
We always use a slice now, even when the arguments don't contain
any spaces or even when there's just one argument,
but consistency seems more important than saving a few characters.
An alternative to Go slices with %q quoting, following Go syntax,
would be to quote a list of strings in CUE syntax.
However, we use Go syntax for lists and string quoting for errors
rather consistently, so it seems best to continue doing so here.
While here, add a godoc for mkCommand, avoid doing a lookup on the
"cmd" field twice, and simplify the code slightly.
Updates #3238.
Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I1a2ae4e0c07236db566ddc9217c1722bb5e99da4
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1197452
Reviewed-by: Roger Peppe <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
0 commit comments