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

archive/zip: AddFS omits trailing slash in directory names #71235

Open
jba opened this issue Jan 12, 2025 · 3 comments · May be fixed by #71239
Open

archive/zip: AddFS omits trailing slash in directory names #71235

jba opened this issue Jan 12, 2025 · 3 comments · May be fixed by #71239
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Milestone

Comments

@jba
Copy link
Contributor

jba commented Jan 12, 2025

Go version

go version go1.24-20241213-RC00 cl/706019355 +e39e965e0e X:fieldtrack,boringcrypto linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='clang'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='clang++'
GCCGO='gccgo'
GO111MODULE='on'
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/usr/local/google/home/jba/.cache/go-build'
GODEBUG=''
GOENV='/usr/local/google/home/jba/.config/go/env'
GOEXE=''
GOEXPERIMENT='fieldtrack,boringcrypto'
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2446417499=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/usr/local/google/home/jba/repos/go/src/go.mod'
GOMODCACHE='/usr/local/google/home/jba/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/usr/local/google/home/jba/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org'
GOROOT='/usr/lib/google-golang'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/usr/local/google/home/jba/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/google-golang/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24-20241213-RC00 cl/706019355 +e39e965e0e X:fieldtrack,boringcrypto'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

The doc for zip.FileHeader.Name says "A trailing slash indicates that this file is a directory."
When change https://go.dev/cl/578415 added directories, it did not include the trailing slashes.

repro: https://go.dev/play/p/9C5y2uZ1A2U?v=gotip

What did you see happen?

dir
dir/file

What did you expect to see?

dir/
dir/file

@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Jan 12, 2025
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jan 12, 2025
@dmitshur dmitshur added this to the Go1.24 milestone Jan 12, 2025
@dmitshur
Copy link
Contributor

CC @songgao, @ianlancetaylor.

@yincongcyincong yincongcyincong linked a pull request Jan 13, 2025 that will close this issue
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642375 mentions this issue: archive/zip: dir add slash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. NeedsFix The path to resolution is known, but the work has not been done. release-blocker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants