mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Remove unnecessary variable assignments (#17695)
* Remove unnecessary variable assignments As title * enable ineffassign Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		@@ -66,7 +66,7 @@ func TestAPINotification(t *testing.T) {
 | 
			
		||||
	// -- GET /notifications/threads/{id} --
 | 
			
		||||
	// get forbidden
 | 
			
		||||
	req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications/threads/%d?token=%s", 1, token))
 | 
			
		||||
	resp = session.MakeRequest(t, req, http.StatusForbidden)
 | 
			
		||||
	session.MakeRequest(t, req, http.StatusForbidden)
 | 
			
		||||
 | 
			
		||||
	// get own
 | 
			
		||||
	req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications/threads/%d?token=%s", thread5.ID, token))
 | 
			
		||||
@@ -100,7 +100,7 @@ func TestAPINotification(t *testing.T) {
 | 
			
		||||
 | 
			
		||||
	lastReadAt := "2000-01-01T00%3A50%3A01%2B00%3A00" //946687801 <- only Notification 4 is in this filter ...
 | 
			
		||||
	req = NewRequest(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/%s/notifications?last_read_at=%s&token=%s", user2.Name, repo1.Name, lastReadAt, token))
 | 
			
		||||
	resp = session.MakeRequest(t, req, http.StatusResetContent)
 | 
			
		||||
	session.MakeRequest(t, req, http.StatusResetContent)
 | 
			
		||||
 | 
			
		||||
	req = NewRequest(t, "GET", fmt.Sprintf("/api/v1/notifications?status-types=unread&token=%s", token))
 | 
			
		||||
	resp = session.MakeRequest(t, req, http.StatusOK)
 | 
			
		||||
@@ -109,7 +109,7 @@ func TestAPINotification(t *testing.T) {
 | 
			
		||||
 | 
			
		||||
	// -- PATCH /notifications/threads/{id} --
 | 
			
		||||
	req = NewRequest(t, "PATCH", fmt.Sprintf("/api/v1/notifications/threads/%d?token=%s", thread5.ID, token))
 | 
			
		||||
	resp = session.MakeRequest(t, req, http.StatusResetContent)
 | 
			
		||||
	session.MakeRequest(t, req, http.StatusResetContent)
 | 
			
		||||
 | 
			
		||||
	assert.Equal(t, models.NotificationStatusUnread, thread5.Status)
 | 
			
		||||
	thread5 = unittest.AssertExistsAndLoadBean(t, &models.Notification{ID: 5}).(*models.Notification)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user