Ah, bad form posting before I tried it in a plain CMD.EXE context. The args are not transformed running from the vanilla command environment. Guess it's a nasty interaction with MSYS.
-Russ On Thu, 11 Jun 2020 at 20:03, Russtopia <[email protected]> wrote: > On windows, Go 1.14 running in my case under MSYS64 > > -- > >> package main >> import ( >> "fmt" >> "os" >> ) >> func main() { >> for idx, a := range os.Args { >> fmt.Printf("arg[%d]: %s\n", idx, a) >> } >> } > > > $ go run argtest.go foo foo:bar foo:/bar/baz > arg[0]: C:\msys64\tmp\go-build182983234\b001\exe\argtest.exe > arg[1]: foo > arg[2]: foo:bar > arg[3]: foo;C:\msys64\bar\baz > > > Note that last arg: seems Go converts 'foo:' to 'foo;C:' and then > interprets the rest as an absolute unix path to be converted to a DOS-style > path! > > Is there a good rationale why this is done? > For context, I am writing a utility that I want to specify paths in the > style of openssh/scp, eg. hostname:path without Go munging them into > Windows-style paths. > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAN4yCu8eJhi8PhgXWqh%2Bs%2BNJez1zthaGOMUNAcxTyyqe0nnxNw%40mail.gmail.com.
