mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2026-04-19 22:04:47 -04:00
gofmt
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ type Client struct {
|
||||
Cache *cache.Cache
|
||||
}
|
||||
|
||||
func NewClient(clientId string) (*Client) {
|
||||
func NewClient(clientId string) *Client {
|
||||
client := Client{
|
||||
ClientID: clientId,
|
||||
Cache: cache.New(15*time.Minute, 15*time.Minute),
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ type SearchResult struct {
|
||||
|
||||
func (client *Client) Search(query string, page string) ([]SearchResult, error) {
|
||||
query = url.QueryEscape(query)
|
||||
req, err := http.NewRequest("GET", "https://imgur.com/search/all/page/" + page + "?scrolled&q_size_is_mpx=off&qs=list&q=" + query, nil)
|
||||
req, err := http.NewRequest("GET", "https://imgur.com/search/all/page/"+page+"?scrolled&q_size_is_mpx=off&qs=list&q="+query, nil)
|
||||
if err != nil {
|
||||
return []SearchResult{}, err
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
|
||||
func HandleAbout(c *fiber.Ctx) error {
|
||||
utils.SetHeaders(c)
|
||||
c.Set("X-Frame-Options", "DENY")
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ 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(),
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user