英文:
VScode golang debug error __debug_bin: Permission Denied
问题
我正在使用一个包含SSH的容器https://hub.docker.com/r/redhat/ubi9-init作为Golang开发环境。当我需要调试一个单元测试时,我遇到了一个权限错误:
我进行了一些搜索,并找到了一些建议在.gitignore
中添加*__debug_bin
并检查Selinux权限。但是这个镜像中没有Selinux。容器中的/Home
目录权限为776,我以root用户的身份登录SSH。还有什么其他尝试的方法吗?
英文:
I am using a container https://hub.docker.com/r/redhat/ubi9-init with SSH as a Golang development environment. When I have to debug a unit test I am receiving a permission error:
I've done some searches and found tips to add *__ debug_bin
on .gitignore
and check the Selinux permissions. Selinux is not present in this image. The /Home
directory permissions in the container is 776 and I am logged in SSH as a root user. What else can I try?
答案1
得分: 3
我在这里遇到了相同的错误。我的问题是我无意中将main.go文件的包名从main更改为其他名称。
我不确定这是否适用于你的情况,但希望能有所帮助。
英文:
I was experiencing the same error here. My issue was that I inadvertently changed the package name of the main.go file from main to something else.
I'm not sure if it's your case, but hope it helps.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论