From 5fdbbec883b9c6dc811818c16a5396aff82b5bbe Mon Sep 17 00:00:00 2001 From: royroyee Date: Sat, 15 Jun 2024 08:59:29 +0900 Subject: [PATCH] Minor fix --- api/packages/packages.go | 7 +------ api/packages/types.go | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/api/packages/packages.go b/api/packages/packages.go index c498edb..bc4a380 100644 --- a/api/packages/packages.go +++ b/api/packages/packages.go @@ -184,17 +184,12 @@ func DownloadPackage(ac *client.AlpaconClient, fileName string, dest string, pac url = systemPackageEntryURL } - type DownloadURL struct { - DownloadURL string `json:"download_url"` - } - - var downloadURL DownloadURL - respBody, err := ac.SendGetRequest(utils.BuildURL(url, packageID, nil)) if err != nil { return err } + var downloadURL DownloadURL err = json.Unmarshal(respBody, &downloadURL) if err != nil { return err diff --git a/api/packages/types.go b/api/packages/types.go index 56fe7f0..c9cbcef 100644 --- a/api/packages/types.go +++ b/api/packages/types.go @@ -43,3 +43,7 @@ type SystemPackageDetail struct { AddedAt string `json:"added_at"` DownloadURL string `json:"download_url"` } + +type DownloadURL struct { + DownloadURL string `json:"download_url"` +}