-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.OS-Windows
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.15.1 windows/amd64
What operating system and processor architecture are you using (go env)?
go env Output
$ go env set GO111MODULE= set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\micro\AppData\Local\go-build set GOENV=C:\Users\micro\AppData\Roaming\go\env set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GOMODCACHE=C:\Users\micro\go\pkg\mod set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=C:\Users\micro\go set GOPRIVATE= set GOPROXY=https://proxy.golang.org,direct set GOROOT=C:\Go set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64 set GCCGO=gccgo set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\micro\AppData\Local\Temp\go-build149210574=/tmp/go-build -gno-record-gcc-switches
What did you do?
package main
import (
"fmt"
"path/filepath"
)
func main() {
fmt.Println(filepath.VolumeName(`\\host\share`))
fmt.Println(filepath.VolumeName(`\\host\share\`))
rel, err := filepath.Rel(`\\host\share`, `\\host\share\file.txt`)
fmt.Printf("rel: %v\n", rel)
fmt.Printf("err: %v\n", err)
rel, err = filepath.Rel(`\\host\share\`, `\\host\share\file.txt`)
fmt.Printf("rel: %v\n", rel)
fmt.Printf("err: %v\n", err)
}\\host\share
\\host\share
rel:
err: Rel: can't make \\host\share\file.txt relative to \\host\share
rel: file.txt
err: <nil>
What did you expect to see?
Expected both invocations of filepath.Rel to return the same relative path
What did you see instead?
First invocation returns an error
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.OS-Windows