LEFT | RIGHT |
(Both sides are equal) |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Package io provides basic interfaces to I/O primitives. | 5 // Package io provides basic interfaces to I/O primitives. |
6 // Its primary job is to wrap existing implementations of such primitives, | 6 // Its primary job is to wrap existing implementations of such primitives, |
7 // such as those in package os, into shared public interfaces that | 7 // such as those in package os, into shared public interfaces that |
8 // abstract the functionality, plus some other related primitives. | 8 // abstract the functionality, plus some other related primitives. |
9 // | 9 // |
10 // Because these interfaces and primitives wrap lower-level operations with | 10 // Because these interfaces and primitives wrap lower-level operations with |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 | 490 |
491 func (t *teeReader) Read(p []byte) (n int, err error) { | 491 func (t *teeReader) Read(p []byte) (n int, err error) { |
492 n, err = t.r.Read(p) | 492 n, err = t.r.Read(p) |
493 if n > 0 { | 493 if n > 0 { |
494 if n, err := t.w.Write(p[:n]); err != nil { | 494 if n, err := t.w.Write(p[:n]); err != nil { |
495 return n, err | 495 return n, err |
496 } | 496 } |
497 } | 497 } |
498 return | 498 return |
499 } | 499 } |
LEFT | RIGHT |