Files
yt-dlp-bot/app/misc.go
2026-03-04 21:06:41 -05:00

20 lines
406 B
Go

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)
}