INNER CODE UNIT · Go
pad
ghostsecurity/reaper · internal/cli/format.go:94
func pad(s string, width int) string {
return fmt.Sprintf("%*s", width, s)
}
func formatSize(n int) string {
switch {
case n == 0:
return "-"
case n < 1024:
return fmt.Sprintf("%dB", n)
case n < 1024*1024:
return fmt.Sprintf("%.1fKB", float64(n)/1024)
default:
return fmt.Sprintf("%.1fMB", float64(n)/(1024*1024))
}
}
func printHeaders(h http.Header) {