From 25c31c33b4a488621c0ab0383d84f5635f242ecc Mon Sep 17 00:00:00 2001 From: "80111+shawnps@users.noreply.github.com" <80111+shawnps@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:11:25 +0900 Subject: [PATCH 1/2] download: update error messages in ModuleName and LatestVersion --- download/proxy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/download/proxy.go b/download/proxy.go index 7eda5c9d..ca7609b6 100644 --- a/download/proxy.go +++ b/download/proxy.go @@ -63,7 +63,7 @@ func (c *ProxyClient) ModuleName(path string) (string, error) { } if resp.StatusCode != http.StatusOK { - return "", fmt.Errorf("could not get module name from %s: %s", u, string(b)) + return "", fmt.Errorf("could not get module name from %s", u) } sp := strings.Split(string(b), "\n") @@ -92,7 +92,7 @@ func (c *ProxyClient) LatestVersion(path string) (string, error) { if resp.StatusCode != http.StatusOK { b, _ := io.ReadAll(resp.Body) - return "", fmt.Errorf("could not get latest module version from %s: %s", u, string(b)) + return "", fmt.Errorf("could not get latest module version from %s", u) } var mv moduleVersion From 581b9736c40276708e7e59d9f5b27e5696b995ab Mon Sep 17 00:00:00 2001 From: "80111+shawnps@users.noreply.github.com" <80111+shawnps@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:15:00 +0900 Subject: [PATCH 2/2] fix --- download/proxy.go | 1 - 1 file changed, 1 deletion(-) diff --git a/download/proxy.go b/download/proxy.go index ca7609b6..65f10bc4 100644 --- a/download/proxy.go +++ b/download/proxy.go @@ -91,7 +91,6 @@ func (c *ProxyClient) LatestVersion(path string) (string, error) { defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - b, _ := io.ReadAll(resp.Body) return "", fmt.Errorf("could not get latest module version from %s", u) }