gvm
gvm copied to clipboard
How to use Go, GVM from a sudo context?
Sometimes I need to run Go command line tools from a privileged environment. However, gvm is trickier to use with sudo
. The best I've found so far is:
$ sudo -E bash
$ <go, gvm, or custom go tool here...>
$ exit
$
However, it would be more convenient to have a one-line syntax for this kind of command call. Any tips?
I tried sudo -E tonixxx clean boil
and sudo -E bash -c 'tonixxx clean boil'
but strangely they were not able to receive my full environment, so bash was not able to find my tonixxx
binary like it can in a normal user shell. I am loading gvm from direnv, in case that matters.
Are there updates here? I have the same problem.
I don't know whether this can answer, can't sudo $(which gvm)
handle this?
Same problem, is there any intention to fix this?