[Nix-dev] Added renameImports utility to goBuildPackage

Luca Bruno lethalman88 at gmail.com
Thu Apr 16 18:48:23 CEST 2015


Sometimes git repos get renamed and break go packages because of
different import paths.
Since today I've added a simple renameImports utility, not sure if that
was worth it because it was easy to do without it, anyway:

renameImports = [
  "foo bar"
  "baz qux"
];

Will rename imports from foo to bar and from baz to qux. The replaced
import is a regexp. This code will simply run govers -m foo bar; govers
-m baz qux.

Since it seems a rather common thing to do, I've decided to add this
common code to buildGoPackage, also it will be easier to switch a day to
something else than govers (just in case).

Hopefully we'll have nixpkgs docs about packaging go stuff a day.

Best regards,


More information about the nix-dev mailing list