From 5d8e07c83576268388b2253a6d6d887c01324ed5 Mon Sep 17 00:00:00 2001 From: Manuel <2084639+tennox@users.noreply.github.com> Date: Wed, 7 Dec 2022 16:03:35 +0000 Subject: doc: add hint about lib.fakeSha256 to go section (#204132) * doc: add hint about lib.fakeSha256 to go section Found it here: https://stackoverflow.com/a/71934521/1633985 Co-authored-by: Valentin Gagarin --- doc/languages-frameworks/go.section.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doc/languages-frameworks/go.section.md') diff --git a/doc/languages-frameworks/go.section.md b/doc/languages-frameworks/go.section.md index 42acab817b6..bca09e59680 100644 --- a/doc/languages-frameworks/go.section.md +++ b/doc/languages-frameworks/go.section.md @@ -11,7 +11,13 @@ The function `buildGoModule` builds Go programs managed with Go modules. It buil In the following is an example expression using `buildGoModule`, the following arguments are of special significance to the function: -- `vendorHash`: is the hash of the output of the intermediate fetcher derivation. `vendorHash` can also take `null` as an input. When `null` is used as a value, rather than fetching the dependencies and vendoring them, we use the vendoring included within the source repo. If you'd like to not have to update this field on dependency changes, run `go mod vendor` in your source repo and set `vendorHash = null;` +- `vendorHash`: is the hash of the output of the intermediate fetcher derivation. + + `vendorHash` can also be set to `null`. + In that case, rather than fetching the dependencies and vendoring them, the dependencies vendored in the source repo will be used. + + To avoid updating this field when dependencies change, run `go mod vendor` in your source repo and set `vendorHash = null;` + To obtain the actual hash, set `vendorHash = lib.fakeSha256;` and run the build ([more details here](https://nixos.org/manual/nixpkgs/stable/#sec-source-hashes)). - `proxyVendor`: Fetches (go mod download) and proxies the vendor directory. This is useful if your code depends on c code and go mod tidy does not include the needed sources to build or if any dependency has case-insensitive conflicts which will produce platform dependant `vendorHash` checksums. ```nix -- cgit 1.4.1