diff options
| author | eltrac <hi@eltr.ac> | 2026-05-26 10:01:45 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-05-26 10:01:45 +0800 |
| commit | 51ed797d38edb3f3884d69064d72108497a24818 (patch) | |
| tree | 916215486eba6f0e7a5f974327a91fdd16e7bbf0 /brewapi.go | |
| parent | 36bc242e9db96e14811736379bbcde5ea7b00bd7 (diff) | |
fix: don't print API error
since packages can only be a formula or a cask, and we request both
formula and cask on every run. so one error is certain.
Diffstat (limited to 'brewapi.go')
| -rw-r--r-- | brewapi.go | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -10,7 +10,6 @@ import ( func GetFormulaFromAPI(pkg string) (*FormulaInfo) { resp, err := http.Get("https://formulae.brew.sh/api/formula/" + pkg + ".json") if err != nil { - print(err) color.Red("❌ Error fetching formula info from brew.sh") return nil } @@ -19,7 +18,7 @@ func GetFormulaFromAPI(pkg string) (*FormulaInfo) { var data FormulaInfo if err := json.Unmarshal(body, &data); err != nil { - color.Red("❌ Error parsing API response from brew.sh") + return nil } return &data @@ -36,7 +35,7 @@ func GetCaskFromAPI(pkg string) (*CaskInfo) { var data CaskInfo if err := json.Unmarshal(body, &data); err != nil { - color.Red("❌ Error parsing API response from brew.sh") + return nil } return &data |
