change utils

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2025-05-09 23:22:12 +02:00
parent 4a3a06fa30
commit 9eee8e60be
+6 -2
View File
@@ -83,11 +83,15 @@ func FetchGitHubAPI(github *github.Client, token, path string) ([]byte, error) {
return bodyBytes, nil return bodyBytes, nil
} }
func PrintInfo(key, value string) { func PrintInfo(key, value string, more ...string) {
if value == "" || value == "0" || value == "0001-01-01 00:00:00 +0000 UTC" { if value == "" || value == "0" || value == "0001-01-01 00:00:00 +0000 UTC" {
return return
} }
fmt.Printf("%s %s\n", GreyStyle.Render(key+":"), GreenStyle.Render(value)) fmt.Printf("%s %s", GreyStyle.Render(key+":"), GreenStyle.Render(value))
if len(more) > 0 {
fmt.Printf(" %s", GreyStyle.Render("("+strings.Join(more, ", ")+")"))
}
fmt.Println()
} }
func WaitForRateLimit(resp *github.Response) { func WaitForRateLimit(resp *github.Response) {