[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Functions](../../index.md) > [Developing in Go](index.md) > Managing dependencies

# Building and managing Go function dependencies

At the build stage, Cloud Functions automatically installs dependencies required for a Go function when creating a new [function version](../../operations/function/version-manage.md).

{% note info %}

The build gets the `ycf` build tag.

{% endnote %}

For this, Cloud Functions supports two methods of automatic dependency management: modules and the `dep` utility.

### mod

[Modules](https://github.com/golang/go/wiki/Modules) are a built-in dependency management solution for `Go`. They are the primary and recommended way to manage dependencies in 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.

{% note warning %}

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

The `go.mod` file must not specify the `Go` version, since the plugin generated by the [builder](../../concepts/builder.md) must use exactly the same `Go` version as the [runtime environment](../../concepts/runtime/index.md).

{% endnote %}

### dep

{% note warning %}

This method of managing dependencies is deprecated and no longer supported in language version 1.16.

{% endnote %}

[Dep](https://golang.github.io/dep/docs/introduction.html) 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 this case, the `dep ensure` command runs just before building the code.

{% note info %}

If you have both `go.mod` and `Gopkg.toml` among the files, the build system may not work as expected. **We do not recommend** using these two files at the same time.

{% endnote %}

Dependency installation is limited in terms of resources and execution time. For more information, see [Quotas and limits in Cloud Functions](../../concepts/limits.md). You can view the dependency installation log via the link displayed in the list of operations.