I'm trying to run my function on GCP via gitlab CI, but it returns the following error:
Function failed to start: no matching function found with name: "RunUsers"
path: test/function.go
file name "function.go"
deploy
gcloud functions deploy test
--runtime=go116
--entry-point=RunUsers
--region=us-east1
--source=.
--trigger-http
package function
import (
"io"
"net/http"
"github.com/GoogleCloudPlatform/functions-framework-go/functions"
_ "github.com/GoogleCloudPlatform/functions-framework-go/funcframework"
)
func init() {
functions.HTTP("RunUsers", RunUsers)
}
func RunUsers(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "OK")
}
Should I remove .mod in
.gcloudignore file?
gcloudignore:
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore
tests/
README.md
Makefile
env/
*.json
sonar-project.properties
.gitlab-ci.yml
cmd/
*.mod
Has anyone gone through this problem?