Closed
Description
Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (
go version
)?
go version go1.6.3 windows/amd64 - What operating system and processor architecture are you using (
go env
)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Hiroshi\go
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GO15VENDOREXPERIMENT=1
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1 - What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
err := os.Symlink(`../..`, "link")
if err != nil {
panic(err)
}
err = os.Chdir("link")
if err != nil {
panic(err)
}
path, err := filepath.EvalSymlinks(".")
if err != nil {
panic(err)
}
fmt.Printf(`EvalSymlinks(".") = %q`+"\n", path)
path, err = filepath.EvalSymlinks("C:.")
if err != nil {
panic(err)
}
fmt.Printf(`EvalSymlinks("C:.") = %q`+"\n", path)
err = os.Chdir("..")
if err != nil {
panic(err)
}
os.Remove("link")
}
- What did you expect to see?
EvalSymlinks(".") = "."
EvalSymlinks("C:.") = "C:." - What did you see instead?
EvalSymlinks(".") = "."
EvalSymlinks("C:.") = "C:...."