Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: Ibrahim AshShohail <[email protected]>
  • Loading branch information
ibrasho committed Sep 21, 2017
1 parent e79c0bd commit 56acbf0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/gps/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package gps

import (
"fmt"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -98,7 +99,6 @@ func PruneProject(baseDir string, lp LockedProject, options PruneOptions, logger
return errors.Wrap(err, "failed to prune Go test files")
}
}

return nil
}

Expand All @@ -123,11 +123,13 @@ func pruneUnusedPackages(lp LockedProject, projectDir string, logger *log.Logger
logger.Printf(" * %s\n", filepath.Join(pr, pkg))
}

fmt.Println("unusedPackages", unusedPackages)
unusedPackagesFiles, err := collectUnusedPackagesFiles(projectDir, unusedPackages)
if err != nil {
return errors.Wrapf(err, "could not collect unused packages' files in %s", pr)
}

fmt.Println("deleting", unusedPackagesFiles)
if err := deleteFiles(unusedPackagesFiles); err != nil {
return errors.Wrapf(err, "")
}
Expand Down Expand Up @@ -159,6 +161,7 @@ func calculateUnusedPackages(lp LockedProject, projectDir string) (map[string]st
return errors.Wrap(err, "unexpected error while calculating unused packages")
}

fmt.Println("pkg", pkg)
if _, ok := imported[pkg]; !ok {
unused[pkg] = struct{}{}
}
Expand Down

0 comments on commit 56acbf0

Please sign in to comment.