From b3c99749f133abf6c04506135c2e4e7567da5254 Mon Sep 17 00:00:00 2001 From: lost+skunk Date: Wed, 4 Sep 2024 20:18:39 +0300 Subject: ошибки MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- misc.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'misc.go') diff --git a/misc.go b/misc.go index 720b4c8..cda4374 100644 --- a/misc.go +++ b/misc.go @@ -64,8 +64,8 @@ type DailyDeviations struct { Deviations []Deviation } -func GetDailyDeviations(page int) (dd DailyDeviations) { - ujson("dabrowse/networkbar/rfy/deviations?page="+strconv.Itoa(page), &dd) +func GetDailyDeviations(page int) (dd DailyDeviations, err Error) { + err = ujson("dabrowse/networkbar/rfy/deviations?page="+strconv.Itoa(page), &dd) return } @@ -78,9 +78,8 @@ type Search struct { ResultsGalleryTemp []Deviation `json:"results"` } -func PerformSearch(query string, page int, scope rune, user ...string) (ss Search, e error) { +func PerformSearch(query string, page int, scope rune, user ...string) (ss Search, err error, daError Error) { var buildurl strings.Builder - e = nil // о5 построение ссылок. switch scope { @@ -90,7 +89,7 @@ func PerformSearch(query string, page int, scope rune, user ...string) (ss Searc buildurl.WriteString("dabrowse/networkbar/tag/deviations?tag=") case 'g', 'f': // поиск артов пользователя или группы if user == nil { - e = errors.New("missing username (last argument)") + err = errors.New("missing username (last argument)") return } @@ -116,7 +115,7 @@ func PerformSearch(query string, page int, scope rune, user ...string) (ss Searc } buildurl.WriteString(strconv.Itoa(page)) - ujson(buildurl.String(), &ss) + daError = ujson(buildurl.String(), &ss) if ss.Results == nil { ss.Results = ss.ResultsGalleryTemp -- cgit v1.2.3