Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io/fs: Sub should return a fs.FS that implements fs.SubFS #45349

Closed
drew-richardson opened this issue Apr 1, 2021 · 1 comment
Closed

io/fs: Sub should return a fs.FS that implements fs.SubFS #45349

drew-richardson opened this issue Apr 1, 2021 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@drew-richardson
Copy link
Contributor

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

$ go version
go version go1.16.2 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/drew-richardson/.cache/go-build"
GOENV="/home/drew-richardson/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/drew-richardson/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/drew-richardson/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="x86_64-pc-linux-gnu-gcc"
CXX="x86_64-pc-linux-gnu-g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build992509347=/tmp/go-build -gno-record-gcc-switche
s"

What did you do?

https://play.golang.org/p/uSfpnL8qxCC

What did you expect to see?

main.noopFS.Open
io/fs.(*subFS).Open
io/fs.(*subFS).Open
io/fs.(*subFS).Open
io/fs.(*subFS).Open
io/fs.(*subFS).Open
main.main
runtime.main
runtime.goexit

What did you see instead?

main.noopFS.Open
io/fs.(*subFS).Open
main.main
runtime.main
runtime.goexit

Comments

fs.subFS could implement fs.SubFS and return a new appropriately scoped fs.subFS and the callstack would collapse. Assuming there are no objections, I'll start working on a change

@gopherbot
Copy link

Change https://golang.org/cl/306769 mentions this issue: io/fs: implement subFS.Sub

@seankhliao seankhliao added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 2, 2021
@odeke-em odeke-em added this to the Go1.17 milestone Apr 3, 2021
@golang golang locked and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants