Commit 0c83f23d authored by Rob Pike's avatar Rob Pike

fix typo in ByteSize example

R=rsc, agl1
CC=golang-dev
https://golang.org/cl/154076
parent 9e829c42
...@@ -1356,17 +1356,17 @@ automatically for printing, even as part of a general type. ...@@ -1356,17 +1356,17 @@ automatically for printing, even as part of a general type.
<pre> <pre>
func (b ByteSize) String() string { func (b ByteSize) String() string {
switch { switch {
case s >= YB: case b >= YB:
return fmt.Sprintf("%.2fYB", b/YB) return fmt.Sprintf("%.2fYB", b/YB)
case s >= PB: case b >= PB:
return fmt.Sprintf("%.2fPB", b/PB) return fmt.Sprintf("%.2fPB", b/PB)
case s >= TB: case b >= TB:
return fmt.Sprintf("%.2fTB", b/TB) return fmt.Sprintf("%.2fTB", b/TB)
case s >= GB: case b >= GB:
return fmt.Sprintf("%.2fGB", b/GB) return fmt.Sprintf("%.2fGB", b/GB)
case s >= MB: case b >= MB:
return fmt.Sprintf("%.2fMB", b/MB) return fmt.Sprintf("%.2fMB", b/MB)
case s >= KB: case b >= KB:
return fmt.Sprintf("%.2fKB", b/KB) return fmt.Sprintf("%.2fKB", b/KB)
} }
return fmt.Sprintf("%.2fB", b) return fmt.Sprintf("%.2fB", b)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment