Skip to content

Commit

Permalink
Quote string arguments in errors
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 728627723
  • Loading branch information
vpasdf authored and copybara-github committed Feb 19, 2025
1 parent d683505 commit cc5de23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion detector/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func DetectorsFromNames(names []string) ([]detector.Detector, error) {
}
}
} else {
return nil, fmt.Errorf("unknown detector %s", n)
return nil, fmt.Errorf("unknown detector %q", n)
}
}
result := make([]detector.Detector, 0, len(resultMap))
Expand Down
4 changes: 2 additions & 2 deletions extractor/filesystem/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func ExtractorsFromNames(names []string) ([]filesystem.Extractor, error) {
}
}
} else {
return nil, fmt.Errorf("unknown extractor %s", n)
return nil, fmt.Errorf("unknown extractor %q", n)
}
}
result := make([]filesystem.Extractor, 0, len(resultMap))
Expand All @@ -303,7 +303,7 @@ func ExtractorsFromNames(names []string) ([]filesystem.Extractor, error) {
func ExtractorFromName(name string) (filesystem.Extractor, error) {
es, ok := extractorNames[strings.ToLower(name)]
if !ok {
return nil, fmt.Errorf("unknown extractor %s", name)
return nil, fmt.Errorf("unknown extractor %q", name)
}
if len(es) != 1 || es[0].Name() != name {
return nil, fmt.Errorf("not an exact name for an extractor: %s", name)
Expand Down
4 changes: 2 additions & 2 deletions extractor/standalone/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func FilterByCapabilities(exs []standalone.Extractor, capabs *plugin.Capabilitie
func ExtractorFromName(name string) (standalone.Extractor, error) {
es, ok := extractorNames[strings.ToLower(name)]
if !ok {
return nil, fmt.Errorf("unknown extractor %s", name)
return nil, fmt.Errorf("unknown extractor %q", name)
}
if len(es) != 1 || es[0].Name() != name {
return nil, fmt.Errorf("not an exact name for an extractor: %s", name)
Expand All @@ -132,7 +132,7 @@ func ExtractorsFromNames(names []string) ([]standalone.Extractor, error) {
}
}
} else {
return nil, fmt.Errorf("unknown extractor %s", n)
return nil, fmt.Errorf("unknown extractor %q", n)
}
}
result := make([]standalone.Extractor, 0, len(resultMap))
Expand Down

0 comments on commit cc5de23

Please sign in to comment.