I'm calling os.Getwd() as part of a very simple test, but I get different 
responses
depending on if I'm executing the test as a binary or not. The windows 
drive is
upper case when executing the test as a binary even when GOPATH uses
a lower case drive.


package main

import (
"fmt"
"os"
"testing"
)

func TestWd(t *testing.T) {
w, _ := os.Getwd()
fmt.Println(w)
}


set GOPATH=c:\code\projects\go
go test . -v

Outputs:
c:\code\projects\go\src\bitbucket.org\flat20\temp

go test -c
temp.test.exe

Outputs:
C:\code\projects\go\src\bitbucket.org\flat20\temp


However, if I set my GOPATH using an upper case drive letter, it all works 
out
as expected. Should GOPATH always use an upper case drive letter? Should
the test binary work differently to a command line "go test"?

Regards,
Andreas



-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to