development

ERROR: gcloud functions deploy Error: go: error loading module

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

Reference

Categories: development

Tagged as: , ,

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.