Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commit416d237

Browse files
authored
Fix version warning parse logic (#172)
1 parent6fd4ea9 commit416d237

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎internal/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ func VersionsMatch(apiVersion string) bool {
1313
iflen(withoutPatchRelease)<3 {
1414
returnfalse
1515
}
16-
majorMinor:=strings.Join(withoutPatchRelease[:len(withoutPatchRelease)-1],".")
16+
majorMinor:=strings.Join(withoutPatchRelease[:2],".")
1717
returnstrings.HasPrefix(strings.TrimPrefix(apiVersion,"v"),strings.TrimPrefix(majorMinor,"v"))
1818
}

‎internal/version/version_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ func TestVersion(t *testing.T) {
2626
Version="1.15.4"
2727
match=VersionsMatch("v2.15.2")
2828
assert.True(t,"versions do not match",!match)
29+
30+
Version="1.12.2+cli.rc1"
31+
match=VersionsMatch("v1.12.9")
32+
assert.True(t,"versions do match",match)
2933
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp