Skip to content
This repository has been archived by the owner on May 11, 2019. It is now read-only.

Commit

Permalink
Correctly filter out only the standard library
Browse files Browse the repository at this point in the history
Closes #9.
  • Loading branch information
tamird committed May 18, 2015
1 parent 4655237 commit f179e48
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bunchfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"go/build"
"io/ioutil"
"os"
"os/exec"
Expand Down Expand Up @@ -231,8 +232,6 @@ func filterCommonBasePackages(depList []string, selfBase string) []string {
func generateBunchfile() error {
bunch := BunchFile{}

gopath := os.Getenv("GOPATH")

goListCommand := []string{"go", "list", "--json", "."}
output, err := exec.Command(goListCommand[0], goListCommand[1:]...).Output()
if err != nil {
Expand All @@ -252,8 +251,8 @@ func generateBunchfile() error {
}

for _, dep := range filterCommonBasePackages(packageInfo.Deps, packageInfo.ImportPath) {
depPath := path.Join(gopath, "src", dep)
if exists, _ := pathExists(depPath); exists {
// check that the package is not part of the standard library
if exists, _ := pathExists(path.Join(build.Default.GOROOT, "src", dep)); !exists {
err = bunch.AddPackage(dep)
if err != nil {
return errors.Trace(err)
Expand Down

0 comments on commit f179e48

Please sign in to comment.