1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
package thumbnail import ( "errors" "os" ) // thumbnailExists reports wether a cached thumbnail exists func thumbnailExists(path string) (bool, error) { _, err := os.Stat(path) if err != nil { return true, err } if errors.Is(err, os.ErrNotExist) { return false, nil } return false, nil }