I'd assume it has nothing to do with Go at all. You should try this with a
minimal C program and look at the results. I assume it's something the
shell is doing.

On Fri, Jun 12, 2020 at 5:09 AM Russtopia <[email protected]> wrote:

> 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
> <https://groups.google.com/d/msgid/golang-nuts/CAN4yCu8eJhi8PhgXWqh%2Bs%2BNJez1zthaGOMUNAcxTyyqe0nnxNw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEkBMfFQbRCaZhNsOVMuv6s2N24LgKPVKOn5PG_CFYgLAMpCOw%40mail.gmail.com.

Reply via email to