Skip to content

path: Documentation regarding / support #17690

Closed
@itsjamie

Description

@itsjamie

What version of Go are you using (go version)?

go version go1.7 windows/amd64

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=C:\Users\tjenkins\go-dev\bin
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\tjenkins\go-dev
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\tjenkins\AppData\Local\Temp\go-build759658326=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1

What did you do?

Creating files on the system and later retrieving them via filepath.Glob. Code further downstream took the returned paths and utilized path.Base to find the base portion, this failed due to the \ vs / difference.

What did you expect to see

Would prefer if the package documentation for path make explicit mention of the lack of support for systems that are not / separated, directing the user to sub package filepath. It mentions slash-separated, which was taken to mean / or \.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions