Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Developing in Go
  2. Managing dependencies

Building and managing Go function dependencies

Written by
Yandex Cloud
Updated at September 23, 2024

At the build stage, Cloud Functions automatically installs dependencies required for a Go function to run when creating a new function version.

Note

The build gets the ycf build tag.

Cloud Functions supports two automatic dependency management methods for this purpose: modules and the dep utility.

modmod

Modules are a built-in dependency management mechanism for the Go language. They represent the main and recommended dependency management method for Cloud Functions.

To deliver dependencies using modules, upload the go.mod file together with the function source code. This will install the latest versions of the packages specified in this file. To specify the versions explicitly, also upload the go.sum file.

Warning

Make sure the module name in the go.mod file is not main.

The go.mod file must not state the Go language version, because the plugin generated by the builder must use exactly the same Go version as the runtime environment.

depdep

Warning

This method of managing dependencies is obsolete and deprecated for version 1.16 of the language.

Dep is a dependency management system for Go.

To deliver dependencies using dep, upload the Gopkg.toml and Gopkg.lock files together with the function source code. In which case the dep ensure command will be invoked just ahead of building the code.

Note

If you have both go.mod and Gopkg.toml among the files, builder performance is not guaranteed. We do not 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 in Cloud Functions. You can view the dependency installation log using the link that appears in the list of operations.

Was the article helpful?

Previous
Overview
Next
Request handler
© 2025 Direct Cursus Technology L.L.C.