(size int64)
| 682 | } |
| 683 | |
| 684 | func FormatBytes(size int64) string { |
| 685 | units := []string{"B", "KB", "MB", "GB"} |
| 686 | |
| 687 | var unitIndex int |
| 688 | floatSize := float64(size) |
| 689 | for unitIndex = 0; unitIndex < len(units)-1; unitIndex++ { |
| 690 | if floatSize < 1024.0 { |
| 691 | break |
| 692 | } |
| 693 | floatSize /= 1024.0 |
| 694 | } |
| 695 | |
| 696 | // Format with one decimal place |
| 697 | return fmt.Sprintf("%.1f%s", floatSize, units[unitIndex]) |
| 698 | } |
| 699 | |
| 700 | func loadDatabaseResume(p string, resumable bool, state *InstallerState) { |
| 701 | fmt.Printf("chosen: %v\n", p) |
no outgoing calls
no test coverage detected