]> Cypherpunks repositories - gostls13.git/commitdiff
various: we don't cast, we convert
authorRob Pike <r@golang.org>
Tue, 6 Dec 2011 03:40:52 +0000 (19:40 -0800)
committerRob Pike <r@golang.org>
Tue, 6 Dec 2011 03:40:52 +0000 (19:40 -0800)
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5437142

src/pkg/compress/bzip2/bit_reader.go
src/pkg/exp/ssh/session_test.go
src/pkg/fmt/doc.go
src/pkg/unicode/graphic.go

index b2c13e50ca4684bfd5d1f5ecf54296b515e76113..b35c69a1ccaa6d75c40cbb680db77acab1457a2b 100644 (file)
@@ -20,7 +20,7 @@ type bitReader struct {
        err  error
 }
 
-// bitReader needs to read bytes from an io.Reader. We attempt to cast the
+// bitReader needs to read bytes from an io.Reader. We attempt to convert the
 // given io.Reader to this interface and, if it doesn't already fit, we wrap in
 // a bufio.Reader.
 type byteReader interface {
index 4be7746d17e2996064182329743cffbbf6c63f12..d4818c29f7051a8bdf6318a02c1f5e48f0f199e1 100644 (file)
@@ -61,7 +61,7 @@ func dial(t *testing.T) *ClientConn {
                                        WantReply bool
                                        Status    uint32
                                }
-                               // TODO(dfc) casting to the concrete type should not be
+                               // TODO(dfc) converting to the concrete type should not be
                                // necessary to send a packet.
                                msg := exitMsg{
                                        PeersId:   ch.(*channel).theirId,
index 747865c6f963d170fa1af2be5c9af835d8a1dd8a..11e9f19f8995be1e5e119bf41107b312c9fad4b4 100644 (file)
        To avoid recursion in cases such as
                type X string
                func (x X) String() string { return Sprintf("<%s>", x) }
-       cast the value before recurring:
+       convert the value before recurring:
                func (x X) String() string { return Sprintf("<%s>", string(x)) }
 
        Format errors:
index 9343bc9b0a9b7951740fe1efd402dac126b5e6b9..2904da6c6d96d7866a887ed2a4c0c74e5f05766e 100644 (file)
@@ -32,8 +32,8 @@ var PrintRanges = []*RangeTable{
 // Such characters include letters, marks, numbers, punctuation, symbols, and
 // spaces, from categories L, M, N, P, S, Zs.
 func IsGraphic(r rune) bool {
-       // We cast to uint32 to avoid the extra test for negative,
-       // and in the index we cast to uint8 to avoid the range check.
+       // We convert to uint32 to avoid the extra test for negative,
+       // and in the index we convert to uint8 to avoid the range check.
        if uint32(r) <= MaxLatin1 {
                return properties[uint8(r)]&pg != 0
        }