This repository was archived by the owner on Aug 26, 2021. It is now read-only.

Description
Sometimes go2nix requires additional packages beyond those required by go build to actually build. For example, if you are packaging coredns, a go get -d ./ is sufficient to fetch all its dependancies for building their main package. However, running go2nix save requires some other packages before it can successfully compile the Nix expressions.
I ran into this a number of times while packaging for Nix, I ended up creating a script that downloads these extra requirements while go2nix saveing:-
#!/bin/sh
while true; do
missing_package=$(go2nix save 2>&1 | awk -F'"' '{print $2}')
[[ -z $missing_package ]] && exit 0
go get -d -v $missing_package
echo "Finished downloading $missing_package"
done