From bfff1bdc0e967f0928dbf4fbe8e7ab174c7d99aa Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Tue, 3 Feb 2026 21:29:14 +0100 Subject: [PATCH 1/2] fix: remove trailing cariage return in windows version check --- cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index 26a09fb..1447ca7 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -59,7 +59,7 @@ func currentVersionFromFile(path string) (string, error) { } if submatch := currentVersionRegexp.FindSubmatch(b); len(submatch) == 2 { - return string(submatch[1]), nil + return strings.TrimSpace(string(submatch[1])), nil } return "", errors.New("github.com/gofiber/fiber was not found in go.mod") From d6bc45fd6d759d9742336d7df3129c74afe0bc67 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Tue, 3 Feb 2026 22:35:11 +0100 Subject: [PATCH 2/2] fix: remove trailing cariage return in windows version check --- cmd/version_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/version_test.go b/cmd/version_test.go index fa5746a..9539555 100644 --- a/cmd/version_test.go +++ b/cmd/version_test.go @@ -98,6 +98,20 @@ require ( at.Equal("v0.0.0-20200926082917-55763e7e6ee3", v) }) + t.Run("can read version from windows clrf file", func(t *testing.T) { + content := "module fiber-demo\r\ngo 1.14\r\nrequire (\r\n" + + "\tgithub.com/gofiber/fiber\r v0.0.0-20200926082917-55763e7e6ee3\r\n" + + "\tgithub.com/jarcoal/httpmock v1.0.6\r\n" + + ")" + + setupCurrentVersionFile(content) + defer teardownCurrentVersionFile() + + v, err := currentVersion() + require.NoError(t, err) + at.Equal("v0.0.0-20200926082917-55763e7e6ee3", v) + }) + t.Run("package not found", func(t *testing.T) { content := `module fiber-demo go 1.14