about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManuel <2084639+tennox@users.noreply.github.com>2022-12-07 16:03:35 +0000
committerGitHub <noreply@github.com>2022-12-07 17:03:35 +0100
commit5d8e07c83576268388b2253a6d6d887c01324ed5 (patch)
tree24d946ea74d425c781da5f563e827dd0b34f9d8b
parenta9cb6a684a737ccbc91655d689fb7e799a1f8e5d (diff)
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 <valentin.gagarin@tweag.io>
-rw-r--r--doc/languages-frameworks/go.section.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/languages-frameworks/go.section.md b/doc/languages-frameworks/go.section.md
index 42acab817b6a5..bca09e59680cc 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