fix: do not expose the name of the root directory
This commit is contained in:
parent
5331969163
commit
0474e40877
@ -86,6 +86,11 @@ func NewFileInfo(opts *FileOptions) (*FileInfo, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Do not expose the name of root directory.
|
||||||
|
if file.Path == "/" {
|
||||||
|
file.Name = "/"
|
||||||
|
}
|
||||||
|
|
||||||
if opts.Expand {
|
if opts.Expand {
|
||||||
if file.IsDir {
|
if file.IsDir {
|
||||||
if err := file.readListing(opts.Checker, opts.ReadHeader); err != nil { //nolint:govet
|
if err := file.readListing(opts.Checker, opts.ReadHeader); err != nil { //nolint:govet
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user