public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/fedora-appstream-metadata] rawhide: update-appstream-metadata: Replace if/elseif/else with switch case
Date: Fri, 13 Nov 2026 11:51:18 GMT	[thread overview]
Message-ID: <179457067830.1.13522125525175347863.rpms-fedora-appstream-metadata-80f985271d9b@fedoraproject.org> (raw)

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")
 		}
 

                 reply	other threads:[~2026-11-13 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179457067830.1.13522125525175347863.rpms-fedora-appstream-metadata-80f985271d9b@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox