Show the root namespace "library" in the dropdown even when there are no repos in it

This commit is contained in:
Roman Vynar
2018-08-14 15:39:21 +03:00
parent 7a752d3f8d
commit 7a3bc551b3
4 changed files with 27 additions and 1 deletions

View File

@@ -42,3 +42,13 @@ func PrettySize(size float64) string {
}
return fmt.Sprintf("%.*f %s", 0, size, units[i])
}
// ItemInSlice check if item is an element of slice
func ItemInSlice(item string, slice []string) bool {
for _, i := range slice {
if i == item {
return true
}
}
return false
}