Skip to content

Commit

Permalink
fix according copilot
Browse files Browse the repository at this point in the history
  • Loading branch information
SchwarzSail committed Jan 11, 2025
1 parent 5d32ab9 commit 950c57c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jwch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,13 @@ func TestGetExamRoomInfo(t *testing.T) {
}

func TestGetNoticesInfo(t *testing.T) {
_, err := stu.GetNoticeInfo(&NoticeInfoReq{PageNum: 2})
content, err := stu.GetNoticeInfo(&NoticeInfoReq{PageNum: 2})
if err != nil {
t.Error(err)
}
if content == nil {
t.Error("content is nil")
}
}

func TestGetCultivatePlan(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions notice.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func parseNoticeInfo(doc *html.Node) ([]*NoticeInfo, error) {
for _, row := range rows {
// 提取日期
dateNode := htmlquery.FindOne(row, ".//span[@class='doclist_time']")
if dateNode == nil {
return nil, fmt.Errorf("cannot find the date")
}
date := strings.TrimSpace(htmlquery.InnerText(dateNode))

// 提取标题
Expand Down

0 comments on commit 950c57c

Please sign in to comment.