Refactor integration test DecodeJSON calls to use generic return value (#37432)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -106,25 +106,20 @@ func TestPackageGo(t *testing.T) {
|
||||
Time time.Time `json:"Time"`
|
||||
}
|
||||
|
||||
info := &Info{}
|
||||
DecodeJSON(t, resp, &info)
|
||||
info := DecodeJSON(t, resp, &Info{})
|
||||
|
||||
assert.Equal(t, packageVersion, info.Version)
|
||||
|
||||
req = NewRequest(t, "GET", fmt.Sprintf("%s/%s/@v/latest.info", url, packageName))
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
info = &Info{}
|
||||
DecodeJSON(t, resp, &info)
|
||||
|
||||
info = DecodeJSON(t, resp, &Info{})
|
||||
assert.Equal(t, packageVersion2, info.Version)
|
||||
|
||||
req = NewRequest(t, "GET", fmt.Sprintf("%s/%s/@latest", url, packageName))
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
info = &Info{}
|
||||
DecodeJSON(t, resp, &info)
|
||||
|
||||
info = DecodeJSON(t, resp, &Info{})
|
||||
assert.Equal(t, packageVersion2, info.Version)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user