How can I configure Google App Engine to not build some Go files?

169 Views Asked by At

I am trying to deploy a set of Google Talk slides to Google App Engine. Some of my example files have build errors on purpose, but I can't deploy these to Google App Engine because it complains that they don't build.

Supposedly I should be able to set nobuild_files: [some_regex] in my app.yaml, but it's not working. I did have to switch to the goapp tool for deploying because of another issue with the vendor folder, so that could be related, IDK.

I tried adding a // +build !appengine to the top of my Go file with the issue, but it didn't seem to do anything.

2

There are 2 best solutions below

0
On

Put your non-compiling code in directory called testdata and it will be ignored by the Go toolchain.

0
On

The nobuild_files in the app.yaml file should work as specified here and are able to see format and configuration of the app.yaml here, such as:

nobuild_files:
- ^(.*/)?#.*#$
- ^(.*/)?.*~$
- ^(.*/)?.*\.py[co]$
- ^(.*/)?.*/RCS/.*$
- ^(.*/)?\..*$
- ^(.*/)?.*\.bak$