Skip to content

Commit

Permalink
fix init with method params
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei28 committed Dec 22, 2023
1 parent 5902191 commit c669f3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (u *URL) hasMethodParams() bool {
if strings.Contains(k, defaultMethodParamsSubStr) {
v = "t"
u.hasMethodParamsCache.Store("t")
break
return true
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions core/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ func TestIntParamCache(t *testing.T) {
v = url.GetMethodIntValue("method", "desc", "testKey", 10)
assert.Equal(t, int64(100), v)
url.ClearCachedInfo()
// test init with method params
assert.True(t, url.hasMethodParams())
// test init without method params
delete(url.Parameters, "method(desc).testKey")
url.ClearCachedInfo()
assert.False(t, url.hasMethodParams())

// test GetPortStr
Expand Down

0 comments on commit c669f3c

Please sign in to comment.