Skip to content

Commit

Permalink
Trimmed error string
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jan 28, 2025
1 parent 1a70a27 commit 2484717
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/cli/check-registry/check-registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestRegistryValidation(t *testing.T) {
{"EmptyArg", "", "registry data file argument testdata is a folder, not a file"},
{"NonExistentFile", "nonexistent.txt", "while loading registry data file: stat testdata/nonexistent.txt: no such file or directory"},
{"InvalidDataFormat", "invalid-data-format.txt", "while loading registry data file: invalid line format (3 fields are required): https://github.com/arduino-libraries/SD.git|Partner;SD"},
{"InvalidUrlFormat", "invalid-url-format.txt", "while filtering registry data file: Following URL are unknown or unsupported git repos:\nhttps://github.com/arduino-libraries/SD\n"},
{"InvalidUrlFormat", "invalid-url-format.txt", "while filtering registry data file: Following URL are unknown or unsupported git repos:\nhttps://github.com/arduino-libraries/SD"},
{"MissingType", "no-type.txt", "invalid type '' used by library 'SD'"},
{"InvalidType", "invalid-type.txt", "invalid type 'foo' used by library 'SD'"},
{"DuplicateRepoURL", "duplicate-url.txt", "registry data file contains duplicate URLs"},
Expand Down
2 changes: 1 addition & 1 deletion internal/libraries/repolist.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (err GitURLsError) Error() string {
fmt.Fprintln(error, v.URL)
}

return error.String()
return strings.TrimSpace(error.String())
}

func filterReposBy(repos []*Repo, matcher repoMatcher) ([]*Repo, error) {
Expand Down

0 comments on commit 2484717

Please sign in to comment.