Cloud functions can use go modules
or vendor
. The vendor
method is preferred because private repos are easily packaged.
If you have intended to use vendor
but use go mod
, you MUST .gcloudignore
the go.mod
& go.sum
files.
The .cloudignore
should stay in the same directory from where you are invoking gcloud functions deploy.
$ cat .gcloudignore
# This file specifies files that are *not*
# uploaded to Google Cloud Platform using gcloud.
# For more information, run:
# $ gcloud topic gcloudignore
#
go.sum
go.mod
.gcloudignore