I ran into this problem when working with setting up tests for the atc0005/elbow project. After discussing it with the alexflint/go-arg developer, I implemented a workaround that saved the current os.Args, injected my replacement values and then restored os.Args after. This seems to work well, but I noticed that the integrii/flaggy lead developer went a different route and it's probably worth studying in more details.
I ran into this problem when working with setting up tests for the atc0005/elbow project. After discussing it with the alexflint/go-arg developer, I implemented a workaround that saved the current
os.Args
, injected my replacement values and then restoredos.Args
after. This seems to work well, but I noticed that the integrii/flaggy lead developer went a different route and it's probably worth studying in more details.