update-deps (#1)
All checks were successful
🚨 Test Code Base / 🔍 🐹 Go Tests (push) Successful in 1m22s
🚨 Test Code Base / 🧹 Lint (push) Successful in 1m31s
🏗️✨ Build Workflow / 🖥️ 🔨 Build (push) Successful in 11m11s

Reviewed-on: #1
Co-authored-by: Ron Rise <ron@siteworxpro.com>
Co-committed-by: Ron Rise <ron@siteworxpro.com>
This commit was merged in pull request #1.
This commit is contained in:
2025-08-26 16:36:17 +00:00
committed by Siteworx Pro Gitea
parent aa1699243a
commit ff66877192
12 changed files with 197 additions and 30 deletions

View File

@@ -60,15 +60,16 @@ func GetLatestImage(httpGet func(url string) (*http.Response, error)) (string, e
if err != nil {
return "", err
}
defer func(Body io.ReadCloser) {
_ = Body.Close()
}(response.Body)
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
return "", fmt.Errorf("error fetching reddit data: %s", response.Status)
}
jsonBytes, err := io.ReadAll(response.Body)
if err != nil {
return "", err
}
redditData := redditResponse{}
err = json.Unmarshal(jsonBytes, &redditData)