I was writing a nixpkgs PR for a Go module, and I needed to patch one of the upstream modules. I thought I would use a go.mod
replace directive for this, which is designed for this use case. I also thought I would use the
go mod edit tool, which is designed for use in scripts to edit go.mod files.
However, it failed because the go binary got confused about where to put cache stuff. Instead I ended up writing a patch file just for the purpose of adding the replace directive.
Does anyone have any recommendations about how to make it possible to use
go mod edit to script editing the go.mod file? It’s a powerful tool for packagers and I’d like to make it easier for people to use, but currently there are 0 usages of the string
go mod edit in nixpkgs.
cc @kalbasit as buildGoModule maintainer.