aboutsummaryrefslogtreecommitdiff
path: root/internal/sources/sources.go
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-03-05 13:04:04 +1300
committerArslaan Pathan <[email protected]>2026-03-05 13:04:04 +1300
commitbd6f6fbe80ef419fdf38c4154add3c4d7a452da0 (patch)
tree51260922a47b28dfdbe846f8def0b78d23a53dd6 /internal/sources/sources.go
parent50e6213fed138fff57e4d206caa109a9f8fc1961 (diff)
downloadkiiro-bd6f6fbe80ef419fdf38c4154add3c4d7a452da0.tar.xz
kiiro-bd6f6fbe80ef419fdf38c4154add3c4d7a452da0.zip
Add sources stuff and dev test and some other thingsa
Diffstat (limited to 'internal/sources/sources.go')
-rw-r--r--internal/sources/sources.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/sources/sources.go b/internal/sources/sources.go
index 3b82c5c..6a99cb2 100644
--- a/internal/sources/sources.go
+++ b/internal/sources/sources.go
@@ -7,6 +7,8 @@ import (
"fmt"
"encoding/json"
"net/http"
+ "log"
+ "io"
)
type PackageListing struct {
@@ -18,7 +20,7 @@ type PackageListing struct {
func FetchPackageListing(url string) (*PackageListing, error) {
fmt.Println("Fetching package listing...")
- resp, err := http.Get(url)
+ res, err := http.Get(url)
if err != nil {
log.Fatal(err)
return nil, err
@@ -37,8 +39,9 @@ func FetchPackageListing(url string) (*PackageListing, error) {
}
var packageListing PackageListing
- err := json.Unmarshal(body, &packageListing)
+ err = json.Unmarshal(body, &packageListing)
if err != nil {
+ log.Fatal(err)
return nil, err
}
fmt.Println("Fetched package listing!")