Skip to content

Commit

Permalink
- fixed display bug #3
Browse files Browse the repository at this point in the history
  • Loading branch information
tawalaya committed Jul 17, 2021
1 parent ab5f4d4 commit 28d243d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,13 @@ func (c *GoGitBackup) Check() error {

c.repos = repos

const TableFormat = "| %10.10s\t| %60.60s\t| %10.10s\t| %10.10s\t|\n"

fmt.Printf("Found the following repositories:\n")
fmt.Printf("| %10.10s\t| %60.60s\t| %10.10s\t| %10.10s\t|\n", "Provider", "Name", "CreatedAt", "Size")
fmt.Printf(TableFormat, "Provider", "Name", "CreatedAt", "Size")

for _, repo := range c.repos {
fmt.Printf("| %10.10s\t| %60.10s\t| %10.10s\t| %10.0d\t|\n", repo.ProviderName, repo.Name, repo.CreatedAt, repo.Size)
fmt.Printf(TableFormat, repo.ProviderName, repo.Name, repo.CreatedAt, fmt.Sprintf("%10.0d", repo.Size))
}

return nil
Expand Down

0 comments on commit 28d243d

Please sign in to comment.