implement progress bar

This commit is contained in:
2026-03-04 21:06:41 -05:00
parent b3d779374b
commit 3cac63ba82
4 changed files with 51 additions and 27 deletions

View File

@@ -1,6 +1,19 @@
package main
import (
"fmt"
"strings"
)
// Helper function to create string pointer
func ptr(s string) *string {
return &s
}
const progressBarLength = 20
func renderProgressBar(percent float64) string {
filled := int(float64(progressBarLength) * percent / 100)
bar := strings.Repeat("█", filled) + strings.Repeat(" ", progressBarLength-filled)
return fmt.Sprintf("[%s] %.0f%%", bar, percent)
}