@@ -16,9 +16,12 @@ import (
1616// PruneOptions represents the pruning options used to write the dependecy tree.
1717type PruneOptions uint8
1818
19+ // PruneProjectOptions is map of prune options per project name.
20+ type PruneProjectOptions map [ProjectRoot ]PruneOptions
21+
1922const (
2023 // PruneNestedVendorDirs indicates if nested vendor directories should be pruned.
21- PruneNestedVendorDirs = 1 << iota
24+ PruneNestedVendorDirs PruneOptions = 1 << iota
2225 // PruneUnusedPackages indicates if unused Go packages should be pruned.
2326 PruneUnusedPackages
2427 // PruneNonGoFiles indicates if non-Go files should be pruned.
@@ -137,7 +140,6 @@ func pruneUnusedPackages(lp LockedProject, projectDir string, logger *log.Logger
137140
138141// calculateUnusedPackages generates a list of unused packages in lp.
139142func calculateUnusedPackages (lp LockedProject , projectDir string ) (map [string ]struct {}, error ) {
140- // TODO(ibrasho): optimize this...
141143 unused := make (map [string ]struct {})
142144 imported := make (map [string ]struct {})
143145 for _ , pkg := range lp .Packages () {
@@ -172,7 +174,6 @@ func calculateUnusedPackages(lp LockedProject, projectDir string) (map[string]st
172174
173175// collectUnusedPackagesFiles returns a slice of all files in the unused packages in projectDir.
174176func collectUnusedPackagesFiles (projectDir string , unusedPackages map [string ]struct {}) ([]string , error ) {
175- // TODO(ibrasho): is this useful?
176177 files := make ([]string , 0 , len (unusedPackages ))
177178
178179 err := filepath .Walk (projectDir , func (path string , info os.FileInfo , err error ) error {
0 commit comments