Alex Netkachov
Alex Netkachov

Reputation: 13532

goapp fmt source code directory

While following the example for golang on Google App Platform website I've found that it recommends to put the source files straight into the subfolder of the application folder, e.g.

app/
  hello/
    hello.go
  app.yaml

I can start the app with goapp serve app.

But I cannot format the source code. My first guess was goapp fmt app - fail. I cannot also build the app: goapp build app

can't load package: package app: cannot find package "app" in any of:
         ....
         ....

Try with GOPATH:

GOPATH=`pwd`/app goapp build

Not much sense as well

can't load package: package .: no buildable Go source files in /....

I also afraid that installing packages might be cumbersome unless I've discovered a right place to start them or configure GOPATH correctly. Any ideas on how it should look like for Google App Engine Go app?

Upvotes: 0

Views: 182

Answers (1)

user4122236
user4122236

Reputation:

To format everything in the application:

  goapp fmt ./app/...

To build all:

 goapp build ./app/...

I usually cd to the directory containing app.yaml so that I can:

 goapp serve
 goapp fmt ./...

and so on.

Upvotes: 2

Related Questions