Pollen: Hide lines that doesn't contain any useful data and hide table
if no datamaster
parent
292acd2317
commit
f1a1bdc7ab
|
@ -76,6 +76,14 @@ func (pollen *Pollen) GetOutput() []string {
|
|||
}
|
||||
|
||||
for _, v2 := range v.Pollen {
|
||||
// Drop rows that have the status: "inga halter" or "ingen rapport"
|
||||
if v2.Day0Description[:3] == "ing" &&
|
||||
v2.Day1Description[:3] == "ing" &&
|
||||
v2.Day2Description[:3] == "ing" &&
|
||||
v2.Day3Description[:3] == "ing" {
|
||||
continue
|
||||
}
|
||||
|
||||
table.Append([]string{
|
||||
v2.Type,
|
||||
v2.Day0Description,
|
||||
|
@ -86,6 +94,10 @@ func (pollen *Pollen) GetOutput() []string {
|
|||
}
|
||||
}
|
||||
|
||||
if table.NumLines() == 0 {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
table.Render()
|
||||
|
||||
return strings.Split(b.String(), "\n")
|
||||
|
|
Loading…
Reference in New Issue