From 94b2ea8da02e90e1e12174736d7fa3369adffe39 Mon Sep 17 00:00:00 2001 From: Bas Toonk Date: Wed, 16 Jul 2025 10:13:16 +0200 Subject: [PATCH] fix: trim CRLF and whitespace from version.txt for cross-platform compatibility Replaces TrimSuffix with TrimSpace in parseCockroachVersion to correctly handle Windows-style line endings (\r\n) and other trailing whitespace. This prevents version parsing errors when version.txt contains CRLF line endings. --- pkg/build/info.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/build/info.go b/pkg/build/info.go index ec7ede1..38a76a0 100644 --- a/pkg/build/info.go +++ b/pkg/build/info.go @@ -71,7 +71,7 @@ func SeemsOfficial() bool { } func parseCockroachVersion(versionTxt string) *version.Version { - txt := strings.TrimSuffix(versionTxt, "\n") + txt := strings.TrimSpace(versionTxt) v, err := version.Parse(txt) if err != nil { panic(fmt.Errorf("could not parse version.txt: %w", err))