function to turn list of targets to list of go packages