Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Pranav Singh <pranavsingh02@hotmail.com>
  • Loading branch information
theBeginner86 committed Dec 15, 2024
1 parent 87c315e commit 740c98f
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions cmd/kanvas-snapshot/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,36 +92,36 @@ type MesheryDesignPayload struct {
Email string `json:"email"`
}

func loader(duration time.Duration) {
total := int(duration.Seconds()) // Total time in seconds
progress := 0

for progress <= total {
printProgressBar(progress, total)
time.Sleep(1 * time.Second) // Sleep for 1 second to update progress
progress++
}
fmt.Println() // Print a new line at the end for better output formatting
}
// func loader(duration time.Duration) {
// total := int(duration.Seconds()) // Total time in seconds
// progress := 0

func printProgressBar(progress, total int) {
barWidth := 25
// for progress <= total {
// printProgressBar(progress, total)
// time.Sleep(1 * time.Second) // Sleep for 1 second to update progress
// progress++
// }
// fmt.Println() // Print a new line at the end for better output formatting
// }

percentage := float64(progress) / float64(total)
barProgress := int(percentage * float64(barWidth))
// func printProgressBar(progress, total int) {
// barWidth := 25

bar := "[" + fmt.Sprintf("%s%s", repeat("=", barProgress), repeat("-", barWidth-barProgress)) + "]"
fmt.Printf("\rProgress %s %.2f%% Complete", bar, percentage*100)
}
// percentage := float64(progress) / float64(total)
// barProgress := int(percentage * float64(barWidth))

// bar := "[" + fmt.Sprintf("%s%s", repeat("=", barProgress), repeat("-", barWidth-barProgress)) + "]"
// fmt.Printf("\rProgress %s %.2f%% Complete", bar, percentage*100)
// }

// Helper function to repeat a character n times
func repeat(char string, times int) string {
result := ""
for i := 0; i < times; i++ {
result += char
}
return result
}
// func repeat(char string, times int) string {
// result := ""
// for i := 0; i < times; i++ {
// result += char
// }
// return result
// }

// ExtractNameFromURI extracts the name from the URI
func ExtractNameFromURI(uri string) string {
Expand Down

0 comments on commit 740c98f

Please sign in to comment.