summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-21 11:17:54 -0600
committerJeff Carr <[email protected]>2024-02-21 11:17:54 -0600
commitabd6ace49e8129942d83f38d08274f0c9783142d (patch)
tree383ac1b1497d16e93408cd9f78cc31182c8209d1
parentf24cbf848728244395a3b20d8246616484a71581 (diff)
add Total() and TotalGo()
-rw-r--r--common.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/common.go b/common.go
index cf7e463..717cc89 100644
--- a/common.go
+++ b/common.go
@@ -160,3 +160,17 @@ func (rl *RepoList) MirrorShownCount() *gui.Node {
func (rl *RepoList) MirrorScanDuration() *gui.Node {
return gui.RawMirror(rl.duration)
}
+
+func (rl *RepoList) Total() int {
+ return len(me.allrepos)
+}
+
+func (rl *RepoList) TotalGo() int {
+ var count int
+ for _, repo := range me.allrepos {
+ if repo.Status.IsGoLang() {
+ count += 1
+ }
+ }
+ return count
+}