You've already forked top-wallpaper
ALL SORTS OF THINGS
This commit is contained in:
@@ -54,9 +54,9 @@ type redditResponse struct {
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
func GetLatestImage() (string, error) {
|
||||
func GetLatestImage(httpGet func(url string) (*http.Response, error)) (string, error) {
|
||||
|
||||
response, err := http.Get("https://www.reddit.com/r/wallpaper/.json")
|
||||
response, err := httpGet("https://www.reddit.com/r/wallpaper/.json")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user