英文:
Is there an alternative to get the Golang code completion in VS Code without installing Go?
问题
我的目标是在Docker上专门使用Go。换句话说,我尽量不直接在我的计算机上安装Go。我在VS Code上编写代码,并使用"Go"扩展。
问题是,当我创建一个main.go
文件时,会出现错误:
在GOROOT()或PATH(/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin)中找不到"go"二进制文件。请检查PATH,或安装Go并重新加载窗口。如果PATH不是您预期的内容,请参阅https://github.com/golang/vscode-go/issues/971
在VS Code中有没有其他方法来获得代码补全功能?
英文:
My goal is to use Go exclusively on Docker. In other words, I try my best not to install Go directly to my computer. And, I am writing the code on a VS Code and use the "Go" extension.
The problem is that when I create a main.go
it throws an error:
Failed to find the "go" binary in either GOROOT() or PATH(/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin). Check PATH, or Install Go and reload the window. If PATH isn't what you expected, see https://github.com/golang/vscode-go/issues/971
Is there an alternative to get the code completion feature in VS Code?
答案1
得分: 1
这可以通过使用远程开发扩展包来实现。VSCode有关于使用容器作为开发环境的详细文档。这将允许您享受Go扩展的所有功能,而无需在您的计算机上直接安装Go。您也可以选择在容器中安装扩展。
请参阅在容器中进行开发。
英文:
This should be achievable using the Remote Development Extension pack. VSCode has good documentation on using containers as your development enviroment. This will allow you to enjoy all of the Go extension's features without needing Go to be installed directly on your machine. You can opt to install the extensions in the container as well.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论