devcontainers / devcontainers/features

Cannot use golang with sudo

Open
#604 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.5k
Forks
621
Avg merge
2d 11h
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.