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 golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAN4yCu_wdDAYjwSSanTjo-0aGNR6gqcdhW6qb1-2YydBCwMf_g%40mail.gmail.com.

Reply via email to