-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.16.1 darwin/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="/Users/simon/Library/Caches/go-build" GOENV="/Users/simon/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/simon/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/simon/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/Cellar/go/1.16.1/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.16.1/libexec/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.16.1" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/simon/go/src/github.com/stackrox/rox/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/np/bn9w387j4ll0xly59mf3p6140000gn/T/go-build3155111729=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
- Want to print all directories, including the ones prefixed with
_and. - Add
// go:embed embed/*directive and store it into aembed.FSvariable - Print all directories included in the
embed.FSvariable
Create the directory structure:
// To create the directory structure run:
// $ echo "embed/.invisible embed/_underscore embed/recursive/.invisible embed/recursive/_underscore embed/recursive/visible" | xargs mkdir -p
/*
embed
├── .invisible
├── _underscore
├── recursive
│ ├── .invisible
│ ├── _underscore
│ └── visible
└── visible
*/
//go:embed embed/*
var FS embed.FS
func main() {
fs.WalkDir(FS, ".", func(p string, d fs.DirEntry, err error) error {
fmt.Println(p)
return nil
})
}
Play golang: https://play.golang.org/p/ui10fGMnItQ
What did you expect to see?
Directories prefixed with . and _ under recursive should be displayed too.
.
embed
embed/.invisible
embed/_underscore
embed/recursive
embed/recursive/.invisible
embed/recursive/_underscore
embed/visible
What did you see instead?
.
embed
embed/.invisible
embed/_underscore
embed/recursive
embed/recursive/visible
embed/visible
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.