summary refs log tree commit diff
path: root/doc/languages-frameworks/go.section.md
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 /doc/languages-frameworks/go.section.md
parenta9cb6a684a737ccbc91655d689fb7e799a1f8e5d (diff)
downloadnixpkgs-5d8e07c83576268388b2253a6d6d887c01324ed5.tar
nixpkgs-5d8e07c83576268388b2253a6d6d887c01324ed5.tar.gz
nixpkgs-5d8e07c83576268388b2253a6d6d887c01324ed5.tar.bz2
nixpkgs-5d8e07c83576268388b2253a6d6d887c01324ed5.tar.lz
nixpkgs-5d8e07c83576268388b2253a6d6d887c01324ed5.tar.xz
nixpkgs-5d8e07c83576268388b2253a6d6d887c01324ed5.tar.zst
nixpkgs-5d8e07c83576268388b2253a6d6d887c01324ed5.zip
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>
Diffstat (limited to 'doc/languages-frameworks/go.section.md')
-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 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