From 2484717f11976cce3af68bd7dc359d8a95a14bd0 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 28 Jan 2025 12:38:56 +0100 Subject: [PATCH] Trimmed error string --- internal/cli/check-registry/check-registry_test.go | 2 +- internal/libraries/repolist.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cli/check-registry/check-registry_test.go b/internal/cli/check-registry/check-registry_test.go index 8c58440a..f4973a35 100644 --- a/internal/cli/check-registry/check-registry_test.go +++ b/internal/cli/check-registry/check-registry_test.go @@ -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"}, diff --git a/internal/libraries/repolist.go b/internal/libraries/repolist.go index a2d12d10..d3f8aaed 100644 --- a/internal/libraries/repolist.go +++ b/internal/libraries/repolist.go @@ -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) {