mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2026-01-29 01:51:13 +00:00
gofmt
This commit is contained in:
@@ -18,8 +18,8 @@ func RenderError(c *fiber.Ctx, code int) error {
|
||||
c.Set("Content-Type", "image/png")
|
||||
return c.Status(code).Send(img)
|
||||
} else {
|
||||
return c.Status(code).Render("errors/" + strconv.Itoa(code), fiber.Map{
|
||||
return c.Status(code).Render("errors/"+strconv.Itoa(code), fiber.Map{
|
||||
"path": c.Path(),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ func FormatDate(date string) (string, error) {
|
||||
}
|
||||
|
||||
return time.Format("Jan 2, 2006 3:04 PM"), nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ package utils
|
||||
|
||||
import "regexp"
|
||||
|
||||
var ImgurRe = regexp.MustCompile(`https?://(i\.)?imgur\.com`)
|
||||
var ImgurRe = regexp.MustCompile(`https?://(i\.)?imgur\.com`)
|
||||
|
||||
@@ -35,7 +35,7 @@ func GetJSON(url string) (gjson.Result, error) {
|
||||
return gjson.Result{}, err
|
||||
}
|
||||
|
||||
switch (res.StatusCode) {
|
||||
switch res.StatusCode {
|
||||
case 200:
|
||||
return gjson.Parse(string(body)), nil
|
||||
case 429:
|
||||
@@ -43,4 +43,4 @@ func GetJSON(url string) (gjson.Result, error) {
|
||||
default:
|
||||
return gjson.Result{}, fmt.Errorf("received status %s, expected 200 OK.\n%s", res.Status, string(body))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,4 +25,4 @@ func SetReqHeaders(req *http.Request) {
|
||||
req.Header.Set("Sec-Fetch-Mode", "cors")
|
||||
req.Header.Set("Sec-Fetch-Site", "same-site")
|
||||
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Firefox/102.0")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user