The solution for me has been using the go 1.21 runtime instead of the go 1.22 runtime in gcloud functions deploy
:
gcloud functions deploy my-gcloud-function \
--runtime=go121 \
...
It seems to me a gcloud
bug, but nevertheless I share the problem and my solution, maybe it was helpful for somebody else.