rakyll / statik

Embed files into a Go executable
Apache License 2.0
3.76k stars 224 forks source link

How do i check if directory exists ? #36

Closed ghost closed 6 years ago

ghost commented 6 years ago

for files, following works

        file, err := statikFS.Open(relativeRequestPath)
        if err == nil {
            if fileInfo, err := file.Stat(); err == nil {
                isValidPath = true
                if !fileInfo.IsDir() {
                    isValidFile = true
                }
            }
            file.Close()
        }