pkg commands: creates a function newXCmd() in charge of creating a new command
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 816
- Forks
- 230
- Avg merge
- 6h 4m
- Merged PRs (30d)
- 1
Description
In some test cases, we need to reset flags & args of the command in test. In the actual used technique, creating the command in global scope and initializes its flags & args in init(), we cannot re-create the command to test it from state-zero.
If there is a testing technique for this case, please enlighten me :-)
Attempt to address this issue: https://github.com/openfaas/faas-cli/compare/master...itscaro:refactor-cmd
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 by reviewing the pkg command implementations and the proposed refactor comparison linked in the issue. Identify how commands, flags, and arguments are currently initialized, then verify that each command can be created from a clean state for the existing test cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100