summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-29 22:26:31 -0400
committerdemo <demo@antix1>2026-05-29 22:26:31 -0400
commitfd87cf3d2604c45320bed226d9fc6ab642d21d32 (patch)
tree2f936624f7354480983b6b9950766258547585cd
parentd0e25d1cb7abce926bf8e5f1f6862e448907bdda (diff)
feat: use simple index variable to print 1., 2., etc.master
-rw-r--r--cmds.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmds.go b/cmds.go
index a0c2334..cfbf9ec 100644
--- a/cmds.go
+++ b/cmds.go
@@ -77,8 +77,8 @@ func (ctrl controller) cmdList() error {
// Assume bucket exists and has keys
b := tx.Bucket([]byte(ctrl.tasksBucketName))
- b.ForEach(func(k, v []byte) error {
- index := binary.BigEndian.Uint64(k)
+ i := 1
+ b.ForEach(func(_, v []byte) error {
var tt taskType
if err := json.Unmarshal(v, &tt); err != nil {
return fmt.Errorf("can't unmarshal: %w", err)
@@ -89,7 +89,9 @@ func (ctrl controller) cmdList() error {
status = "DONE"
}
- fmt.Printf("%d. (%s) %s\n", index, status, tt.What)
+ fmt.Printf("%d. (%s) %s\n", i, status, tt.What)
+ i++
+
return nil
})