Skip to content

Commit

Permalink
Remove unnecessary variable assignments (go-gitea#17695)
Browse files Browse the repository at this point in the history
* Remove unnecessary variable assignments

As title

* enable ineffassign

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
  • Loading branch information
3 people authored and Stelios Malathouras committed Mar 28, 2022
1 parent 1fa8a8d commit 301de10
Show file tree
Hide file tree
Showing 32 changed files with 59 additions and 72 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ linters:
- misspell
- gocritic
- bidichk
- ineffassign
enable-all: false
disable-all: true
fast: false
Expand Down
1 change: 0 additions & 1 deletion cmd/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ Gitea or set your environment appropriately.`, "")
}
} else if lastline > 0 {
fmt.Fprintf(out, "\n")
lastline = 0
}

fmt.Fprintf(out, "Checked %d references in total\n", total)
Expand Down
1 change: 0 additions & 1 deletion contrib/environment-to-ini/environment-to-ini.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ func DecodeSectionKey(encoded string) (string, string) {
if !inKey {
if splitter := strings.Index(remaining, "__"); splitter > -1 {
section += remaining[:splitter]
inKey = true
key += remaining[splitter+2:]
} else {
section += remaining
Expand Down
4 changes: 2 additions & 2 deletions integrations/api_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ func TestAPIGetComment(t *testing.T) {
session := loginUser(t, repoOwner.Name)
token := getTokenForLoggedInUser(t, session)
req := NewRequestf(t, "GET", "/api/v1/repos/%s/%s/issues/comments/%d", repoOwner.Name, repo.Name, comment.ID)
resp := session.MakeRequest(t, req, http.StatusOK)
session.MakeRequest(t, req, http.StatusOK)
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/issues/comments/%d?token=%s", repoOwner.Name, repo.Name, comment.ID, token)
resp = session.MakeRequest(t, req, http.StatusOK)
resp := session.MakeRequest(t, req, http.StatusOK)

var apiComment api.Comment
DecodeJSON(t, resp, &apiComment)
Expand Down
4 changes: 2 additions & 2 deletions integrations/api_issue_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestAPIModifyLabels(t *testing.T) {

//DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
resp = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)

}

Expand Down Expand Up @@ -203,6 +203,6 @@ func TestAPIModifyOrgLabels(t *testing.T) {

//DeleteLabel
req = NewRequest(t, "DELETE", singleURLStr)
resp = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)

}
2 changes: 1 addition & 1 deletion integrations/api_issue_milestone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ func TestAPIIssuesMilestone(t *testing.T) {
assert.Equal(t, int64(2), apiMilestones[0].ID)

req = NewRequest(t, "DELETE", fmt.Sprintf("/api/v1/repos/%s/%s/milestones/%d?token=%s", owner.Name, repo.Name, apiMilestone.ID, token))
resp = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)
}
16 changes: 8 additions & 8 deletions integrations/api_issue_reaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ func TestAPIIssuesReactions(t *testing.T) {
req := NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "wrong",
})
resp := session.MakeRequest(t, req, http.StatusForbidden)
session.MakeRequest(t, req, http.StatusForbidden)

//Delete not allowed reaction
req = NewRequestWithJSON(t, "DELETE", urlStr, &api.EditReactionOption{
Reaction: "zzz",
})
resp = session.MakeRequest(t, req, http.StatusOK)
session.MakeRequest(t, req, http.StatusOK)

//Add allowed reaction
req = NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "rocket",
})
resp = session.MakeRequest(t, req, http.StatusCreated)
resp := session.MakeRequest(t, req, http.StatusCreated)
var apiNewReaction api.Reaction
DecodeJSON(t, resp, &apiNewReaction)

//Add existing reaction
resp = session.MakeRequest(t, req, http.StatusForbidden)
session.MakeRequest(t, req, http.StatusForbidden)

//Get end result of reaction list of issue #1
req = NewRequestf(t, "GET", urlStr)
Expand Down Expand Up @@ -96,24 +96,24 @@ func TestAPICommentReactions(t *testing.T) {
req := NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "wrong",
})
resp := session.MakeRequest(t, req, http.StatusForbidden)
session.MakeRequest(t, req, http.StatusForbidden)

//Delete none existing reaction
req = NewRequestWithJSON(t, "DELETE", urlStr, &api.EditReactionOption{
Reaction: "eyes",
})
resp = session.MakeRequest(t, req, http.StatusOK)
session.MakeRequest(t, req, http.StatusOK)

//Add allowed reaction
req = NewRequestWithJSON(t, "POST", urlStr, &api.EditReactionOption{
Reaction: "+1",
})
resp = session.MakeRequest(t, req, http.StatusCreated)
resp := session.MakeRequest(t, req, http.StatusCreated)
var apiNewReaction api.Reaction
DecodeJSON(t, resp, &apiNewReaction)

//Add existing reaction
resp = session.MakeRequest(t, req, http.StatusForbidden)
session.MakeRequest(t, req, http.StatusForbidden)

//Get end result of reaction list of issue #1
req = NewRequestf(t, "GET", urlStr)
Expand Down
6 changes: 3 additions & 3 deletions integrations/api_notification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_pull_review_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func TestAPIPullReview(t *testing.T) {
assert.EqualValues(t, "COMMENT", review.State)
assert.EqualValues(t, 0, review.CodeCommentsCount)
req = NewRequestf(t, http.MethodDelete, "/api/v1/repos/%s/%s/pulls/%d/reviews/%d?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, review.ID, token)
resp = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)

// test CreatePullReview Comment without body but with comments
req = NewRequestWithJSON(t, http.MethodPost, fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/reviews?token=%s", repo.OwnerName, repo.Name, pullIssue.Index, token), &api.CreatePullReviewOptions{
Expand Down
7 changes: 3 additions & 4 deletions integrations/api_repo_edit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func TestAPIRepoEdit(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
Expand Down Expand Up @@ -223,15 +222,15 @@ func TestAPIRepoEdit(t *testing.T) {
// Do some tests with invalid URL for external tracker and wiki
repoEditOption.ExternalTracker.ExternalTrackerURL = "htp://www.somewebsite.com"
req = NewRequestWithJSON(t, "PATCH", url, &repoEditOption)
resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
repoEditOption.ExternalTracker.ExternalTrackerURL = "http://www.somewebsite.com"
repoEditOption.ExternalTracker.ExternalTrackerFormat = "http://www.somewebsite.com/{user/{repo}?issue={index}"
req = NewRequestWithJSON(t, "PATCH", url, &repoEditOption)
resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
repoEditOption.ExternalTracker.ExternalTrackerFormat = "http://www.somewebsite.com/{user}/{repo}?issue={index}"
repoEditOption.ExternalWiki.ExternalWikiURL = "htp://www.somewebsite.com"
req = NewRequestWithJSON(t, "PATCH", url, &repoEditOption)
resp = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
session.MakeRequest(t, req, http.StatusUnprocessableEntity)

//Test small repo change through API with issue and wiki option not set; They shall not be touched.
*repoEditOption.Description = "small change"
Expand Down
1 change: 0 additions & 1 deletion integrations/api_repo_file_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ func TestAPICreateFile(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
Expand Down
3 changes: 1 addition & 2 deletions integrations/api_repo_file_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func TestAPIDeleteFile(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
Expand Down Expand Up @@ -111,7 +110,7 @@ func TestAPIDeleteFile(t *testing.T) {
deleteFileOptions.SHA = "badsha"
url = fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo1.Name, treePath, token2)
req = NewRequestWithJSON(t, "DELETE", url, &deleteFileOptions)
resp = session.MakeRequest(t, req, http.StatusBadRequest)
session.MakeRequest(t, req, http.StatusBadRequest)

// Test creating a file in repo16 by user4 who does not have write access
fileID++
Expand Down
1 change: 0 additions & 1 deletion integrations/api_repo_file_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func TestAPIUpdateFile(t *testing.T) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
Expand Down
3 changes: 1 addition & 2 deletions integrations/api_repo_get_contents_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
Expand Down Expand Up @@ -139,7 +138,7 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
// Test file contents a file with a bad ref
ref = "badref"
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?ref=%s", user2.Name, repo1.Name, treePath, ref)
resp = session.MakeRequest(t, req, http.StatusNotFound)
session.MakeRequest(t, req, http.StatusNotFound)

// Test accessing private ref with user token that does not have access - should fail
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo16.Name, treePath, token4)
Expand Down
3 changes: 1 addition & 2 deletions integrations/api_repo_get_contents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
// Get user2's token
session := loginUser(t, user2.Name)
token2 := getTokenForLoggedInUser(t, session)
session = emptyTestSession(t)
// Get user4's token
session = loginUser(t, user4.Name)
token4 := getTokenForLoggedInUser(t, session)
Expand Down Expand Up @@ -141,7 +140,7 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
// Test file contents a file with a bad ref
ref = "badref"
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?ref=%s", user2.Name, repo1.Name, treePath, ref)
resp = session.MakeRequest(t, req, http.StatusNotFound)
session.MakeRequest(t, req, http.StatusNotFound)

// Test accessing private ref with user token that does not have access - should fail
req = NewRequestf(t, "GET", "/api/v1/repos/%s/%s/contents/%s?token=%s", user2.Name, repo16.Name, treePath, token4)
Expand Down
4 changes: 2 additions & 2 deletions integrations/api_repo_tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ func TestAPIRepoTags(t *testing.T) {

// delete tag
delReq := NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/tags/%s?token=%s", user.Name, repoName, newTag.Name, token)
resp = session.MakeRequest(t, delReq, http.StatusNoContent)
session.MakeRequest(t, delReq, http.StatusNoContent)

// check if it's gone
resp = session.MakeRequest(t, req, http.StatusNotFound)
session.MakeRequest(t, req, http.StatusNotFound)
}

func createNewTagUsingAPI(t *testing.T, session *TestSession, token string, ownerName, repoName, name, target, msg string) *api.Tag {
Expand Down
12 changes: 6 additions & 6 deletions integrations/api_repo_teams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ func TestAPIRepoTeams(t *testing.T) {

url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "NonExistingTeam", token)
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusNotFound)
session.MakeRequest(t, req, http.StatusNotFound)

// AddTeam with user4
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
req = NewRequest(t, "PUT", url)
res = session.MakeRequest(t, req, http.StatusForbidden)
session.MakeRequest(t, req, http.StatusForbidden)

// AddTeam with user2
user = unittest.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)
session = loginUser(t, user.Name)
token = getTokenForLoggedInUser(t, session)
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
req = NewRequest(t, "PUT", url)
res = session.MakeRequest(t, req, http.StatusNoContent)
res = session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request

// DeleteTeam
url = fmt.Sprintf("/api/v1/repos/%s/teams/%s?token=%s", publicOrgRepo.FullName(), "team1", token)
req = NewRequest(t, "DELETE", url)
res = session.MakeRequest(t, req, http.StatusNoContent)
res = session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusUnprocessableEntity) // test duplicate request
}
20 changes: 10 additions & 10 deletions integrations/api_repo_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ func TestAPIRepoTopic(t *testing.T) {

// Test delete a topic
req = NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "Topicname1", token2)
res = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)

// Test add an existing topic
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "Golang", token2)
res = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)

// Test add a topic
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "topicName3", token2)
res = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)

// Test read topics using token
req = NewRequest(t, "GET", url)
Expand All @@ -96,7 +96,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
res = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
Expand All @@ -107,7 +107,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
res = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
Expand All @@ -118,7 +118,7 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
res = session.MakeRequest(t, req, http.StatusNoContent)
session.MakeRequest(t, req, http.StatusNoContent)
req = NewRequest(t, "GET", url)
res = session.MakeRequest(t, req, http.StatusOK)
DecodeJSON(t, res, &topics)
Expand All @@ -129,15 +129,15 @@ func TestAPIRepoTopic(t *testing.T) {
req = NewRequestWithJSON(t, "PUT", url, &api.RepoTopicOptions{
Topics: newTopics,
})
res = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
session.MakeRequest(t, req, http.StatusUnprocessableEntity)

// Test add a topic when there is already maximum
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "t26", token2)
res = session.MakeRequest(t, req, http.StatusUnprocessableEntity)
session.MakeRequest(t, req, http.StatusUnprocessableEntity)

// Test delete a topic that repo doesn't have
req = NewRequestf(t, "DELETE", "/api/v1/repos/%s/%s/topics/%s?token=%s", user2.Name, repo2.Name, "Topicname1", token2)
res = session.MakeRequest(t, req, http.StatusNotFound)
session.MakeRequest(t, req, http.StatusNotFound)

// Get user4's token
session = loginUser(t, user4.Name)
Expand All @@ -153,6 +153,6 @@ func TestAPIRepoTopic(t *testing.T) {

// Test add a topic to repo with write access (requires repo admin access)
req = NewRequestf(t, "PUT", "/api/v1/repos/%s/%s/topics/%s?token=%s", user3.Name, repo3.Name, "topicName", token4)
res = session.MakeRequest(t, req, http.StatusForbidden)
session.MakeRequest(t, req, http.StatusForbidden)

}
2 changes: 1 addition & 1 deletion integrations/api_team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@ func TestAPITeamSearch(t *testing.T) {
csrf = GetCSRF(t, session, "/"+org.Name)
req = NewRequestf(t, "GET", "/api/v1/orgs/%s/teams/search?q=%s", org.Name, "team")
req.Header.Add("X-Csrf-Token", csrf)
resp = session.MakeRequest(t, req, http.StatusForbidden)
session.MakeRequest(t, req, http.StatusForbidden)

}
4 changes: 2 additions & 2 deletions integrations/api_user_orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ func TestMyOrgs(t *testing.T) {

session := emptyTestSession(t)
req := NewRequest(t, "GET", "/api/v1/user/orgs")
resp := session.MakeRequest(t, req, http.StatusUnauthorized)
session.MakeRequest(t, req, http.StatusUnauthorized)

normalUsername := "user2"
session = loginUser(t, normalUsername)
token := getTokenForLoggedInUser(t, session)
req = NewRequest(t, "GET", "/api/v1/user/orgs?token="+token)
resp = session.MakeRequest(t, req, http.StatusOK)
resp := session.MakeRequest(t, req, http.StatusOK)
var orgs []*api.Organization
DecodeJSON(t, resp, &orgs)
user3 := unittest.AssertExistsAndLoadBean(t, &models.User{Name: "user3"}).(*models.User)
Expand Down
2 changes: 1 addition & 1 deletion integrations/eventsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestEventSourceManagerRun(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?token=%s&status-types=unread", token))
resp = session.MakeRequest(t, req, http.StatusOK)
Expand Down
Loading

0 comments on commit 301de10

Please sign in to comment.