Skip to content

Commit 8114d66

Browse files
committed
feedback
1 parent ebef8d4 commit 8114d66

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

client/v2/internal/util/util.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ func isSupportedVersion(input string, buildInfo *debug.BuildInfo) bool {
5757
continue
5858
}
5959

60-
if version <= dep.Version {
61-
return true
62-
}
63-
64-
return false
60+
return version <= dep.Version
6561
}
6662

6763
return true // if cannot find the module consider it's supported
@@ -77,7 +73,7 @@ func parseSinceComment(input string) (string, string) {
7773
input = strings.ToLower(input)
7874
input = strings.ReplaceAll(input, "cosmos sdk", "cosmos-sdk")
7975

80-
re := regexp.MustCompile(`\/\/\s?since: (\S+) (\S+)`)
76+
re := regexp.MustCompile(`\/\/\s*since: (\S+) (\S+)`)
8177
matches := re.FindStringSubmatch(input)
8278
if len(matches) >= 3 {
8379
moduleName, version = matches[1], matches[2]

client/v2/internal/util/util_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ func TestParseSinceComment(t *testing.T) {
102102
expectedModuleName: "",
103103
expectedVersion: "",
104104
},
105+
{
106+
input: "// Since: Cosmos SDK 0.50",
107+
expectedModuleName: "cosmos-sdk",
108+
expectedVersion: "v0.50",
109+
},
105110
{
106111
input: "// since: Cosmos SDK 0.50",
107112
expectedModuleName: "cosmos-sdk",

0 commit comments

Comments
 (0)