Hi, I started gogland. I can't running

148 views Asked by At

I started gogland. I have a running problem. enter image description here

enter image description here

1

There are 1 answers

2
dlsniper On

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