microcks / microcks/microcks-cli
chore: replace deprecated function usages (`filepath.HasPrefix` and `client.IsErrNotFound`)
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 52
- Forks
- 68
- Avg merge
- 6h 54m
- Merged PRs (30d)
- 10
Description
Describe the bug
The codebase contains a few function calls that have been deprecated by their respective upstream libraries. Continuing to use them creates technical debt and makes future library upgrades difficult.
pkg/connectors/container_client.go:232: Usesclient.IsErrNotFound(err)from the Docker SDK, which is deprecated.cmd/importDir_test.go:71: Usesfilepath.HasPrefix(path, root), which has been deprecated since Go 1.0 because it does not respect path boundaries.
Expected behavior
The codebase should use modern, supported equivalents for these operations.
Actual behavior
Deprecated functions are used, triggering linter warnings (SA1019).
How to Reproduce?
Reproducer:
- Run
staticcheck ./...locally. - Observe the deprecation warnings (
SA1019) for both functions.
Microcks version or git rev
main (Latest)
Install method (docker-compose, helm chart, operator, docker-desktop extension,...)
CLI
Additional information
This is a good first issue.
client.IsErrNotFound(err)should be replaced withcerrdefs.IsNotFound(err).filepath.HasPrefixshould be replaced withstrings.HasPrefix(path, root+string(filepath.Separator)).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with pkg/connectors/container_client.go:232 and cmd/importDir_test.go:71, then run staticcheck ./... to reproduce the SA1019 warnings. Replace the deprecated calls with the equivalents named in the issue and run the relevant tests plus staticcheck; done means both warnings are gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- cli, testing
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100