Improve the Note.String function (with emojis!!1)
This commit is contained in:
parent
eb9f2ed4ce
commit
987cccd189
15
noten.go
15
noten.go
@ -21,7 +21,20 @@ type Note struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (n *Note) String() string {
|
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
|
// Noten returns a list of the grades of all graded or signed up modules
|
||||||
|
Loading…
x
Reference in New Issue
Block a user