From 715421d626df612c78264a6377edcca1fbb1e36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Wed, 14 Oct 2020 08:26:51 +0000 Subject: Apply 2 suggestion(s) to 1 file(s) --- internal/vfs/zip/archive.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go index 5a49a2a4..ba15af20 100644 --- a/internal/vfs/zip/archive.go +++ b/internal/vfs/zip/archive.go @@ -156,7 +156,7 @@ func (a *zipArchive) readArchive() { // addPathDirectory adds a directory for a given path func (a *zipArchive) addPathDirectory(path string) { - // Split makes `path` with `/` + // Split dir and file from `path` path, _ = filepath.Split(path) if path == "" { return @@ -184,11 +184,7 @@ func (a *zipArchive) findFile(name string) *zip.File { func (a *zipArchive) findDirectory(name string) *zip.FileHeader { name = filepath.Join(dirPrefix, name) - if dir := a.directories[name+"/"]; dir != nil { - return dir - } - - return nil + return a.directories[name+"/"] } // Open finds the file by name inside the zipArchive and returns a reader that can be served by the VFS -- cgit v1.2.3