]> Cypherpunks repositories - gostls13.git/commitdiff
fix typo in ByteSize example
authorRob Pike <r@golang.org>
Thu, 12 Nov 2009 03:39:57 +0000 (19:39 -0800)
committerRob Pike <r@golang.org>
Thu, 12 Nov 2009 03:39:57 +0000 (19:39 -0800)
R=rsc, agl1
CC=golang-dev
https://golang.org/cl/154076

doc/effective_go.html

index c4a573a54b83e23ccc3d0712d6692833b970ab8d..2d6403d0de774e6e87c2dff42e500c859be3d781 100644 (file)
@@ -1356,17 +1356,17 @@ automatically for printing, even as part of a general type.
 <pre>
 func (b ByteSize) String() string {
        switch {
-       case s >= YB:
+       case b >= YB:
                return fmt.Sprintf("%.2fYB", b/YB)
-       case s >= PB:
+       case b >= PB:
                return fmt.Sprintf("%.2fPB", b/PB)
-       case s >= TB:
+       case b >= TB:
                return fmt.Sprintf("%.2fTB", b/TB)
-       case s >= GB:
+       case b >= GB:
                return fmt.Sprintf("%.2fGB", b/GB)
-       case s >= MB:
+       case b >= MB:
                return fmt.Sprintf("%.2fMB", b/MB)
-       case s >= KB:
+       case b >= KB:
                return fmt.Sprintf("%.2fKB", b/KB)
        }
        return fmt.Sprintf("%.2fB", b)