(ctx context.Context, statFS StatFS, path string)
| 1913 | } |
| 1914 | |
| 1915 | func StatFSExists(ctx context.Context, statFS StatFS, path string) (string, bool, error) { |
| 1916 | if existsFS, ok := statFS.(ExistsFS); ok { |
| 1917 | return existsFS.Exists(ctx, path) |
| 1918 | } |
| 1919 | |
| 1920 | dirName, _, err := statFS.Stat(ctx, path) |
| 1921 | switch { |
| 1922 | case err == nil: |
| 1923 | return dirName, true, nil |
| 1924 | case errors.Is(err, os.ErrNotExist): |
| 1925 | return "", false, nil |
| 1926 | default: |
| 1927 | return "", false, err |
| 1928 | } |
| 1929 | } |
| 1930 | |
| 1931 | type CallerStatFS struct { |
| 1932 | bk *engineutil.Client |
no test coverage detected