Open blacktop opened 1 year ago
Does this issue belong in https://github.com/spf13/pflag which does the flag parsing for Cobra?
There are no issues with pflag's handling of uint64, nor Cobra's usage of pflag: Playground demo. It is Viper that uses the cast package, which is probably why you are seeing a problem. Here is a Playground demo that confirms the difference, though the build will likely time out due to Viper's dependency chain.
PR spf13/cast#155 just needs to be merged to fix Cobra CLIs that rely on Viper.
I forgot to mention that if you need a temporary workaround until things get fixed, you can vendor your module's dependencies and swap the copy of caste.go in the vendor directory for the one in the PR.
You'll also want to commit the vendor directory to your repository.
That way, your packages and their dependencies that use cast will work as they should, even when they're installed using go install
or go get
.
@memreflect thank you SO much for taking the time to triage this!! ❤️ AND for writing such a clear and concise example PoC 👍
The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:
ping
ToUintE() fails to parse uint bigger than math.MaxInt64 in the cast dependancy. This prevents people from using numbers like macOS kernel addresses as arguents to cobra:
example:
fails because it thinks I entered 0 as the --vaddr (virtual address) to be disassembled