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 {
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,
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:
// 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
}