in vhdbuilder/release-notes/autonotes/main.go [77:140]
func run(ctx context.Context, cancel context.CancelFunc, fl *flags) []error {
var include, ignore map[string]bool
includeString := stripWhitespace(fl.include)
if len(includeString) > 0 {
include = map[string]bool{}
includeTokens := strings.Split(includeString, ",")
for _, token := range includeTokens {
include[token] = true
}
}
ignoreString := stripWhitespace(fl.ignore)
if len(ignoreString) > 0 {
ignore = map[string]bool{}
ignoreTokens := strings.Split(ignoreString, ",")
for _, token := range ignoreTokens {
ignore[token] = true
}
}
enforceInclude := len(include) > 0
artifactsToDownload := map[string]string{}
fmt.Printf("\n")
for key, value := range artifactToPath {
if ignore[key] {
fmt.Printf("Ignoring as artifact explicitly excluded \"%s\" with path \"%s\"\n", key, value)
continue
}
if enforceInclude && !include[key] {
fmt.Printf("Ignoring as not artifact not explicitly included \"%s\" with path \"%s\"\n", key, value)
continue
}
artifactsToDownload[key] = value
}
fmt.Printf("\n")
for sku, path := range artifactsToDownload {
fmt.Printf("Including artifact \"%s\" with path \"%s\"\n", sku, path)
}
var errs []error
// In theory, this could be done in parallel using a goroutine.
// In practice, the "az" command breaks if you call it in parallel.
for sku, path := range artifactsToDownload {
if strings.Contains(path, "AKSWindows") {
err := getReleaseNotesWindows(sku, path, fl)
if err != nil {
errs = append(errs, err)
}
} else {
err := getReleaseNotes(sku, path, fl)
if err != nil {
errs = append(errs, err)
}
}
}
return errs
}