buildGoModule replace behavior

Where can I learn more or help with making buildGoModule better?

As I see it right now the replace directive isn’t correctly implemented if you change the import/upstream location. It fetches the module but stores it under the wrong path.

The function itself is implemented here: nixpkgs/default.nix at e3fbbb1d108988069383a78f424463e6be087707 · NixOS/nixpkgs · GitHub