Building and managing dependencies
At the build stage, Cloud Functions automatically installs dependencies necessary for a function to run. This is done when creating a new function version.
ycf build tag is set for the build.
Cloud Functions supports two ways to automatically manage dependencies: using modules and the
Modules are built-in dependency management mechanisms for the
Go programming language. This is the main and recommended way to manage dependencies in Cloud Functions.
To install dependencies using modules, import the
go.mod file together with the function source code. This installs the latest versions of the packages specified in this file. To explicitly specify the versions, you should also import the
Make sure the module name in the
go.mod file is not
Dep is the dependency management system for
To install dependencies using the
dep utility, import the
Gopkg.lock files together with the function source code. In this case, the
dep ensure command is run just before the code is built.
If you have both the
Gopkg.toml files, builder performance isn't guaranteed. We don't recommend using these two files at the same time.
The process of installing dependencies has resource and execution time limits. For more information, see Quotas and limits. You can view the dependency installation log using the link that appears in the list of operations.