英文:
Hi, I started gogland. I can't running
问题
我已经启动了Gogland。我遇到了一个正在运行的问题。
英文:
I started gogland. I have a running problem.
答案1
得分: 1
错误消息表示您必须选择一个文件才能使配置工作。具体来说,它必须是一个包含 func main()
声明的文件。
您可以使用运行类型:Package 而不是文件来运行一个包。
例如,如果您的主程序位于 $GOPATH/src/github.com/dlsniper/demo/cmd/mycmd/main.go
下,则需要使用 github.com/dlsniper/demo/cmd/mycmd
来运行它。
此外,从您粘贴的屏幕截图来看,似乎您不在一个有效的 Go 工作区中。请参阅这里关于 Go 工作区是什么以及如何创建的内容:https://golang.org/doc/code.html#Workspaces
最后,如果您更喜欢使用视觉指南,请查看这个视频,了解如何在 Gogland 中创建和使用运行配置:https://www.youtube.com/watch?v=ko-wKntCLjg
英文:
The error message says that you much pick a file in order for the configuration to work. Specifically it must be a file containing the func main()
declaration.
You can use the Run Type: Package instead of file in order to run a package.
For example, if your main is under $GOPATH/src/github.com/dlsniper/demo/cmd/mycmd/main.go
then you need to use github.com/dlsniper/demo/cmd/mycmd
in order to run it.
Moreover, from the screenshot you've pasted, it seems like you are not under a valid Go workspace. Please see here what a Go Workspace is and how to create one: https://golang.org/doc/code.html#Workspaces
Finally, if you prefer a visual guide for this, please have a look at this video on how to create and use Run Configurations in Gogland: https://www.youtube.com/watch?v=ko-wKntCLjg
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论