From 987cccd189280122dbe4a93329a4ed30daa4d169 Mon Sep 17 00:00:00 2001 From: Marcel Transier Date: Sun, 6 Oct 2019 19:59:58 +0200 Subject: [PATCH] Improve the Note.String function (with emojis!!1) --- noten.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/noten.go b/noten.go index 53afc87..28b693c 100644 --- a/noten.go +++ b/noten.go @@ -21,7 +21,20 @@ type Note struct { } func (n *Note) String() string { - return fmt.Sprintf("%s: %s", n.Name, n.Note) + var status string + switch n.Status { + case "angemeldet": + status = "⏳ - " + case "bestanden": + status = "✔ " + case "nicht bestanden": + // Not sure if thats the correct value. + // Can't test it. Never failed an exam :P + status = "✖ " + default: + status = "❓" + } + return fmt.Sprintf("%s%s %s", status, n.Note, n.Name) } // Noten returns a list of the grades of all graded or signed up modules