1. 06 Apr, 2015 2 commits
    • Brad Fitzpatrick's avatar
      bytes, strings: add Reader.Size methods · c264c873
      Brad Fitzpatrick authored
      As noted on recently on golang-nuts, there's currently no way to know
      the total size of a strings.Reader or bytes.Reader when using ReadAt
      on them. Most callers resort to wrapping it in an io.SectionReader to
      retain that information.
      
      The SizeReaderAt abstraction (an io.ReaderAt with a Size() int64
      method) has proven useful as a way of expressing a concurrency-safe
      read-only number of bytes.
      
      As one example, see http://talks.golang.org/2013/oscon-dl.slide#49 and
      the rest of that presentation for its use in dl.google.com.
      
      SizeReaderAt is also used in the open source google-api-go-client, and
      within Google's internal codebase, where it exists in a public package
      created in 2013 with the package comment: "These may migrate to the
      standard library after we have enough experience with their feel."
      
      I'm still as happy with the SizeReaderAt abstraction and its
      composabilty as I was in 2013, so I'd like to make these two Readers
      also be SizeReaderAts.
      
      Fixes #9667
      
      Change-Id: Ie6f145ada419dd116280472d8c029f046d5edf70
      Reviewed-on: https://go-review.googlesource.com/3199Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      c264c873
    • Paul Marks's avatar
      net: dialChannel should not treat an expired deadline as noDeadline. · c50a8416
      Paul Marks authored
      Now, only a zero deadline is interpreted as noDeadline.  Any other time
      in the past yields an immediate timeout.
      
      TestConnectDeadlineInThePast already covers this case.  We just need to
      un-skip it for plan9, where dialChannel is used.
      
      Change-Id: I995fd1a632c31f8004dac772c3d7c43a2a5853b0
      Reviewed-on: https://go-review.googlesource.com/8435Reviewed-by: default avatarMikio Hara <mikioh.mikioh@gmail.com>
      c50a8416
  2. 04 Apr, 2015 5 commits
  3. 03 Apr, 2015 20 commits
  4. 02 Apr, 2015 13 commits