1 commit
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1f0b2424c0
|
chore(io): migrate pkg/cache to Medium abstraction (#288)
Some checks failed
Release: Tag Push / build (amd64, windows, windows-latest) (push) Waiting to run
Release: Tag Push / build (arm64, darwin, macos-latest) (push) Waiting to run
Release: Tag Push / release (push) Blocked by required conditions
Release: Tag Push / build (amd64, linux, ubuntu-latest) (push) Failing after 2s
Release: Tag Push / build (arm64, linux, ubuntu-latest) (push) Failing after 2s
* chore(io): migrate pkg/cache to Medium abstraction - Added `medium io.Medium` field to `Cache` struct in `pkg/cache/cache.go`. - Updated `cache.New` constructor to accept `io.Medium` as the first parameter, defaulting to `io.Local` if `nil`. - Migrated all file operations in `pkg/cache` to use the `medium` abstraction. - Replaced `os.IsNotExist` with `errors.Is(err, fs.ErrNotExist) || os.IsNotExist(err)` for better compatibility. - Updated caller in `internal/cmd/pkgcmd/cmd_search.go`. - Added unit tests in `pkg/cache/cache_test.go` using `io.MockMedium`. Parent: #101 * chore(io): migrate pkg/cache to Medium abstraction - Added `medium io.Medium` field to `Cache` struct in `pkg/cache/cache.go`. - Updated `cache.New` constructor to accept `io.Medium` as the first parameter, defaulting to `io.Local` if `nil`. - Migrated all file operations in `pkg/cache` to use the `medium` abstraction. - Replaced `os.IsNotExist` with `errors.Is(err, fs.ErrNotExist) || os.IsNotExist(err)` for better compatibility. - Updated caller in `internal/cmd/pkgcmd/cmd_search.go`. - Added unit tests in `pkg/cache/cache_test.go` using `io.MockMedium`. Note: CI failure 'org-gate' is a policy-level check for external contributors and does not indicate a code error. Verified with local build and tests. * chore(io): migrate pkg/cache to Medium abstraction - Added `medium io.Medium` field to `Cache` struct in `pkg/cache/cache.go`. - Updated `cache.New` constructor to accept `io.Medium` as the first parameter, defaulting to `io.Local` if `nil`. - Migrated all file operations in `pkg/cache` to use the `medium` abstraction. - Replaced `os.IsNotExist` with `errors.Is(err, fs.ErrNotExist) || os.IsNotExist(err)` for better compatibility. - Updated caller in `internal/cmd/pkgcmd/cmd_search.go`. - Added unit tests in `pkg/cache/cache_test.go` using `io.MockMedium`. Note: CI failure 'org-gate' is a policy-level check for external contributors and does not indicate a code error. Verified with local build and tests. * chore(io): migrate pkg/cache to Medium abstraction - Added `medium io.Medium` field to `Cache` struct in `pkg/cache/cache.go`. - Updated `cache.New` constructor to accept `io.Medium` as the first parameter, defaulting to `io.Local` if `nil`. - Migrated all file operations in `pkg/cache` to use the `medium` abstraction. - Updated caller in `internal/cmd/pkgcmd/cmd_search.go`. - Added unit tests in `pkg/cache/cache_test.go` using `io.MockMedium`, with explicit error handling as requested in PR review. Parent: #101 |