@@ -81,11 +81,23 @@ func ExtractWithFlags(buildFlags []string, patterns []string, extractTests bool)
81
81
}
82
82
}
83
83
84
- testMessage := ""
84
+ // If CODEQL_EXTRACTOR_GO_[OPTION_]EXTRACT_VENDOR_DIRS is "true", we extract `vendor` directories;
85
+ // otherwise (the default) is to exclude them from extraction
86
+ includeVendor := util .IsVendorDirExtractionEnabled ()
87
+
88
+ modeNotifications := make ([]string , 0 , 2 )
85
89
if extractTests {
86
- testMessage = " (test extraction enabled)"
90
+ modeNotifications = append (modeNotifications , "test extraction enabled" )
91
+ }
92
+ if includeVendor {
93
+ modeNotifications = append (modeNotifications , "extracting vendor directories" )
87
94
}
88
- log .Printf ("Running packages.Load%s." , testMessage )
95
+
96
+ modeMessage := strings .Join (modeNotifications , ", " )
97
+ if modeMessage != "" {
98
+ modeMessage = " (" + modeMessage + ")"
99
+ }
100
+ log .Printf ("Running packages.Load%s." , modeMessage )
89
101
90
102
// This includes test packages if either we're tracing a `go test` command,
91
103
// or if CODEQL_EXTRACTOR_GO_OPTION_EXTRACT_TESTS is set to "true".
@@ -233,9 +245,6 @@ func ExtractWithFlags(buildFlags []string, patterns []string, extractTests bool)
233
245
// Construct a list of directory segments to exclude from extraction, starting with ".."
234
246
excludedDirs := []string {`\.\.` }
235
247
236
- // If CODEQL_EXTRACTOR_GO_[OPTION_]EXTRACT_VENDOR_DIRS is "true", we extract `vendor` directories;
237
- // otherwise (the default) is to exclude them from extraction
238
- includeVendor := util .IsVendorDirExtractionEnabled ()
239
248
if ! includeVendor {
240
249
excludedDirs = append (excludedDirs , "vendor" )
241
250
}
0 commit comments