Skip to content

Commit

Permalink
fix: package names
Browse files Browse the repository at this point in the history
Signed-off-by: shivamsouravjha <[email protected]>
  • Loading branch information
shivamsouravjha committed Nov 4, 2024
1 parent 5f73c2a commit f7bc97a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func main() {
router.Use(sentrygin.New(sentrygin.Options{}))
router.Use(CORSMiddleware())

services.UpdateFunds()
ticker := startTicker()
rankUpdater := startRankUpdater()
routes.Routes(router)
Expand Down
10 changes: 5 additions & 5 deletions services/parse_service.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main
package services

import (
"context"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -42,7 +42,7 @@ func setupCheck() {
}
}

func main() {
func UpdateFunds() {
setupCheck()
scheduler := cron.New()

Expand Down Expand Up @@ -103,7 +103,7 @@ func performUploadTask() {
}
defer resp.Body.Close()

body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
log.Println("Error reading response body:", err)
return
Expand Down Expand Up @@ -136,7 +136,7 @@ func setRequestHeaders(req *http.Request) {
func extractPortfolioLinks(htmlContent string) []string {
assert(len(htmlContent) == 0, "extractPortfolioLinks len(htmlContent) == 0")

re := regexp.MustCompile(`Monthly portfolio for the month end.*?<a[^>]+href="([^"]+)"`)
re := regexp.MustCompile(`Monthly portfolio for the month *?<a[^>]+href="([^"]+)"`)
matches := re.FindAllStringSubmatch(htmlContent, -1)

assert(len(matches) == 0, "extractPortfolioLinks len(matches) == 0")
Expand Down

0 comments on commit f7bc97a

Please sign in to comment.