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

Commit 8ad6e0e

Browse files
committed
debug
Signed-off-by: Ibrahim AshShohail <[email protected]>
1 parent 24bf56f commit 8ad6e0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/gps/prune.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package gps
66

77
import (
8+
"fmt"
89
"log"
910
"os"
1011
"path/filepath"
@@ -123,11 +124,13 @@ func pruneUnusedPackages(lp LockedProject, projectDir string, logger *log.Logger
123124
logger.Printf(" * %s\n", filepath.Join(pr, pkg))
124125
}
125126

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

133+
fmt.Println("unusedPackagesFiles", unusedPackagesFiles)
131134
if err := deleteFiles(unusedPackagesFiles); err != nil {
132135
return errors.Wrapf(err, "")
133136
}
@@ -143,6 +146,7 @@ func calculateUnusedPackages(lp LockedProject, projectDir string) (map[string]st
143146
for _, pkg := range lp.Packages() {
144147
imported[pkg] = struct{}{}
145148
}
149+
fmt.Println("imported", imported)
146150

147151
err := filepath.Walk(projectDir, func(path string, info os.FileInfo, err error) error {
148152
if err != nil {
@@ -160,6 +164,7 @@ func calculateUnusedPackages(lp LockedProject, projectDir string) (map[string]st
160164
}
161165

162166
pkg = filepath.ToSlash(pkg)
167+
fmt.Println(pkg)
163168
if _, ok := imported[pkg]; !ok {
164169
unused[pkg] = struct{}{}
165170
}

0 commit comments

Comments
 (0)