Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 82de513

Browse files
authored
Merge pull request #384 from sauyon/gobuild
extractor: Extract the working directory if no packages are passed
2 parents 6122223 + e22bf96 commit 82de513

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

extractor/cli/go-extractor/go-extractor.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,14 @@ func main() {
108108
}
109109

110110
if len(patterns) == 0 {
111-
log.Println("Nothing to extract.")
112-
} else {
113-
log.Printf("Build flags: '%s'; patterns: '%s'\n", strings.Join(buildFlags, " "), strings.Join(patterns, " "))
114-
err := extractor.ExtractWithFlags(buildFlags, patterns)
115-
if err != nil {
116-
log.Fatalf("Error running go tooling: %s\n", err.Error())
117-
}
111+
log.Println("No packages explicitly provided, adding '.'")
112+
patterns = []string{"."}
113+
}
114+
115+
log.Printf("Build flags: '%s'; patterns: '%s'\n", strings.Join(buildFlags, " "), strings.Join(patterns, " "))
116+
err := extractor.ExtractWithFlags(buildFlags, patterns)
117+
if err != nil {
118+
log.Fatalf("Error running go tooling: %s\n", err.Error())
118119
}
119120

120121
if memprofile != "" {

0 commit comments

Comments
 (0)