From 819221d01df65106d39b5695389d2152a7491983 Mon Sep 17 00:00:00 2001 From: milarin Date: Fri, 3 Mar 2023 14:50:27 +0100 Subject: [PATCH] use aliases for ID types --- api.go | 4 ++-- types.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api.go b/api.go index 860c96f..f4c0560 100644 --- a/api.go +++ b/api.go @@ -181,8 +181,8 @@ func (api *Api) getChapterEntriesByPageIndex(ctx context.Context, novelID NovelI entryElems.Each(func(i int, s *goquery.Selection) { td3 := s.Find("td:nth-child(3) a.chp-release") - chapterID := ChapterID(td3.Text()) - groupID := GroupID(path.Base(s.Find("td:nth-child(2) a").AttrOr("href", ""))) + chapterID := td3.Text() + groupID := path.Base(s.Find("td:nth-child(2) a").AttrOr("href", "")) link := "https:" + td3.AttrOr("href", "") date, err := time.Parse("01/02/06", strings.TrimSpace(s.Find("td:first-child").Text())) diff --git a/types.go b/types.go index be2e02c..f60bfc7 100644 --- a/types.go +++ b/types.go @@ -5,10 +5,10 @@ import ( "time" ) -type NovelID string -type ChapterID string -type ReadingListID string -type GroupID string +type NovelID = string +type ChapterID = string +type ReadingListID = string +type GroupID = string type ReadingList struct { ID ReadingListID `json:"id"`