Launching golang appengine app

I'm having trouble setting up my appengine app in GoLand.

I can successfully run my appengine app from the command line using `dev_appserver.py app.yaml`. When I run from w/in GoLand, I get the following on the console:

GOROOT=/usr/local/go #gosetup
GOPATH=/Users/clyde/Documents/gospace #gosetup
/usr/local/go/bin/go serve -host localhost -port 8080 -admin_port 8000 . #gosetup
go: unknown subcommand "serve"
Run 'go help' for usage.

Debugger finished with exit code 2

I'm running macOS Sierra, Go 1.6, gcloud (Google Cloud SDK) 187.0.0, and the app-engine-go gcloud component.

Thanks!

 

 

0
5 comments

It doesn't look like you are using the AppEngine DDK but rather the normal Go SDK.

Go to Settings | Go | GOROOT and add the location of the AppEngine SDK to the IDE and select that as the SDK for the project and this should work.

You may need to delete the previous run configuration and create a new one via Run | Edit Configurations | + | Go AppEngine.

0

I don't have the Google AppEngine SDK installed. Rather, I installed the Google Cloud SDK with the app-engine-go component, per this document: https://cloud.google.com/appengine/docs/standard/go/download

I tried changing the Settings | Go | GOROOT to ~/google-cloud-sdk/bin, but that didn't work.

Perhaps GoLand doesn't support the Cloud SDK?

0

You cannot currently add ~/google-cloud-sdk/bin as SDK root, you need to add the location of the Go component as SDK root, for example ~/google-cloud-sdk/platform/google_appengine/goroot-1.6 (the path maybe slightly different on your machine)

As a side note, I highly encourage you to use the Go 1.8 support in AppEngine in order to take advantage of the unified context package.

2

Ah, got it. I hadn't poked around google-cloud-sdk/platform, so I didn't notice the goodies in there.

I set the GoLand GOROOT to /Users/clyde/google-cloud-sdk/platform/google_appengine/goroot-1.6, and now GoLand successfully finds goapp.

The next challenge was to help goapp find dev_appserver.py with this GOROOT. I got this to work by adding an environment variable to the GoLand run configuration: APPENGINE_DEV_APPSERVER=/Users/clyde/google-cloud-sdk/bin/dev_appserver.py

Thanks for the tip on Go 1.8 -- I'll take a look.

1

I'm happy this works out now. And yes, the other issue has also ust been fixed in the latest 2018.1 EAP and should work now.

If you have any further questions or suggestions about this, please don't hesitate to contact the JetBrains team here or on the YouTrack issue tracker https://youtrack.jetbrains.com/issues/Go

0

Please sign in to leave a comment.