Open matloob opened 1 year ago
This is in the context of https://go.dev/cl/488375 / #58508.
(attn @golang/plan9)
In practice only GOPATH is likely to have a list value, and if a Plan 9 directory name in the path needed quoting it would likely cause all sorts of pain. But in theory one could have, for example, a directory with spaces in its name (imported from another OS?) and failing to quote it would mean that the output from go env
could not safely be executed in the shell to assign GOPATH correctly.
Therefore my opinion is that the elements of a list should be individually quoted.
I suspect that Russ is the only person on the Go team familiar enough with the Plan 9 shell to implement quoting, but if someone wants to contribute a fix once CL 488375 is merged I'd be glad to review it.
if someone wants to contribute a fix once CL 488375 is merged I'd be glad to review it.
I'll do it.
We'd like a plan 9 expert to double check this: In PrintEnv in cmd/go/internal/envcmd/env.go, plan9's handling behavior is different based on whether there's a null byte. If there's not a null byte present it quotes the string, and if there isn't it puts them in a parenthesized list, but doesn't quote each of the listed strings. We want to make sure that not quoting each of the strings in the list is the intended behavior.