diff options
| author | lost+skunk <[email protected]> | 2024-09-04 20:18:39 +0300 |
|---|---|---|
| committer | lost+skunk <[email protected]> | 2024-09-04 20:18:39 +0300 |
| commit | b3c99749f133abf6c04506135c2e4e7567da5254 (patch) | |
| tree | 2dd1abd4967eae3d151eff30404ab28ffd7054b1 /misc.go | |
| parent | 4487cdcbe9ed2ad4bc661c04600336505054177c (diff) | |
| download | devianter-b3c99749f133abf6c04506135c2e4e7567da5254.tar.gz devianter-b3c99749f133abf6c04506135c2e4e7567da5254.tar.bz2 devianter-b3c99749f133abf6c04506135c2e4e7567da5254.zip | |
ошибки
Diffstat (limited to 'misc.go')
| -rw-r--r-- | misc.go | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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 |
