There's also Google's shlex package:
https://pkg.go.dev/github.com/google/shlex?tab=doc
Incidentally, on Windows Go has to do this manually on startup. See
commandLineToArgv in https://golang.org/src/os/exec_windows.go
-Ben
On Tuesday, April 21, 2020 at 4:27:41 AM UTC+12, Michał Łowicki wrote:
I also wanted this (when I was learning Go I just assumed & would work in
front of any expression, including function calls). I opened proposal
https://github.com/golang/go/issues/22647 where there was some discussion,
and further discussion over at https://github.com/golang/go/issues/9097,
whi