public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedora-appstream-metadata] rawhide: update-appstream-metadata: Replace if/elseif/else with switch case
@ 2026-11-13 11:51 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-11-13 11:51 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/fedora-appstream-metadata
Branch : rawhide
Commit : 80f985271d9b6bfc233420f9a10cb6843aa24803
Author : Timothée Ravier <tim@siosm.fr>
Date   : 2026-11-11T21:44:58+01:00
Stats  : +4/-3 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/fedora-appstream-metadata/c/80f985271d9b6bfc233420f9a10cb6843aa24803?branch=rawhide

Log:
update-appstream-metadata: Replace if/elseif/else with switch case

---
diff --git a/update-appstream-metadata.go b/update-appstream-metadata.go
index f4b905e..8212733 100644
--- a/update-appstream-metadata.go
+++ b/update-appstream-metadata.go
@@ -311,7 +311,8 @@ func main() {
 		r.Date = getStartDate(c.Version)
 		r.DateEol = getEolDate(c.Version)
 
-		if c.Status == "Under Development" {
+		switch c.Status {
+		case "Under Development":
 			r.Type = "development"
 			betaurl := fmt.Sprintf("https://fedoramagazine.org/announcing-fedora-%s-beta/", c.Version)
 			if isValidURL(betaurl) {
@@ -319,10 +320,10 @@ func main() {
 			} else {
 				r.Description.P = "The upcoming release of Fedora Linux."
 			}
-		} else if c.Status == "Active" || c.Status == "EOL" {
+		case "Active", "EOL":
 			r.Type = "stable"
 			r.Description.P = fmt.Sprintf("https://fedoramagazine.org/announcing-fedora-linux-%s/", c.Version)
-		} else {
+		default:
 			log.Fatal("Should never be reached")
 		}
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13 11:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 11:51 [rpms/fedora-appstream-metadata] rawhide: update-appstream-metadata: Replace if/elseif/else with switch case 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox