features icon indicating copy to clipboard operation
features copied to clipboard

Cannot use golang with sudo

Open dotoleeoak opened this issue 2 years ago • 0 comments

When I run golang with sudo like the following, the execution fails.

$ sudo go run main.go 
sudo: go: command not found

It seems the reason is that go binary is installed under /usr/local, which sudo(uid 0) cannot access.

dotoleeoak avatar Jul 04 '23 14:07 dotoleeoak