1. 06 May, 2016 1 commit
  2. 12 Apr, 2016 1 commit
  3. 08 Apr, 2016 1 commit
  4. 06 Apr, 2016 1 commit
    • Brad Fitzpatrick's avatar
      io: add ReadAtSizer interface · 7f39f21c
      Brad Fitzpatrick authored
      ReadAtSizer is a common abstraction for a stateless,
      concurrently-readable fixed number of bytes.
      
      This interface has existed in various codebases for over 3 years (previously
      usually named SizeReaderAt). It is used inside Google in dl.google.com
      (mentioned in https://talks.golang.org/2013/oscon-dl.slide) and other
      packages. It is used in Camlistore, in Juju, in the Google API Go client, in
      github.com/nightlyone/views, and 33 other pages of Github search results.
      
      It is implemented by io.SectionReader, bytes.Reader, strings.Reader, etc.
      
      Time to finally promote this interface to the standard library and give it a
      standard name, blessing it as best practice.
      
      Updates #7263
      Updates #14889
      
      Change-Id: Id28c0cafa7d2d37e8887c54708b5daf1b11c83ea
      Reviewed-on: https://go-review.googlesource.com/21492
      
      Reviewed-by: default avatarRob Pike <r@golang.org>
      7f39f21c
  5. 05 Apr, 2016 1 commit
  6. 02 Mar, 2016 1 commit
    • Brad Fitzpatrick's avatar
      all: single space after period. · 5fea2ccc
      Brad Fitzpatrick authored
      The tree's pretty inconsistent about single space vs double space
      after a period in documentation. Make it consistently a single space,
      per earlier decisions. This means contributors won't be confused by
      misleading precedence.
      
      This CL doesn't use go/doc to parse. It only addresses // comments.
      It was generated with:
      
      $ perl -i -npe 's,^(\s*// .+[a-z]\.)  +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.)  +([A-Z])')
      $ go test go/doc -update
      
      Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7
      Reviewed-on: https://go-review.googlesource.com/20022
      
      Reviewed-by: default avatarRob Pike <r@golang.org>
      Reviewed-by: default avatarDave Day <djd@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      5fea2ccc
  7. 29 Feb, 2016 1 commit
    • Brad Fitzpatrick's avatar
      all: remove public named return values when useless · 351c15f1
      Brad Fitzpatrick authored
      Named returned values should only be used on public funcs and methods
      when it contributes to the documentation.
      
      Named return values should not be used if they're only saving the
      programmer a few lines of code inside the body of the function,
      especially if that means there's stutter in the documentation or it
      was only there so the programmer could use a naked return
      statement. (Naked returns should not be used except in very small
      functions)
      
      This change is a manual audit & cleanup of public func signatures.
      
      Signatures were not changed if:
      
      * the func was private (wouldn't be in public godoc)
      * the documentation referenced it
      * the named return value was an interesting name. (i.e. it wasn't
        simply stutter, repeating the name of the type)
      
      There should be no changes in behavior. (At least: none intended)
      
      Change-Id: I3472ef49619678fe786e5e0994bdf2d9de76d109
      Reviewed-on: https://go-review.googlesource.com/20024
      
      
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAndrew Gerrand <adg@golang.org>
      351c15f1
  8. 06 Oct, 2015 2 commits
  9. 29 Jun, 2015 1 commit
  10. 29 May, 2015 1 commit
  11. 15 Apr, 2015 1 commit
  12. 08 Apr, 2015 1 commit
  13. 16 Sep, 2014 1 commit
  14. 08 Sep, 2014 1 commit
  15. 26 Aug, 2014 1 commit
  16. 16 Apr, 2014 1 commit
  17. 18 Jul, 2013 1 commit
  18. 23 May, 2013 1 commit
    • Daniel Morsing's avatar
      io: Prioritize WriterTos over ReaderFroms in Copy. · fdc4ce6e
      Daniel Morsing authored
      This only affects calls where both ReaderFrom and WriterTo are implemented. WriterTo can issue one large write, while ReaderFrom must Read until EOF, potentially reallocating when out of memory. With one large Write, the Writer only needs to allocate once.
      
      This also helps in ioutil.Discard since we can avoid copying memory when the Reader implements WriterTo.
      
      R=golang-dev, dsymonds, remyoudompheng, bradfitz
      CC=golang-dev, minux.ma
      https://golang.org/cl/9462044
      fdc4ce6e
  19. 19 Apr, 2013 1 commit
  20. 09 Apr, 2013 1 commit
  21. 13 Feb, 2013 1 commit
  22. 08 Feb, 2013 1 commit
  23. 31 Jan, 2013 1 commit
    • Russ Cox's avatar
      io: guarantee err == nil for full reads in ReadFull and ReadAtLeast · 662ff542
      Russ Cox authored
      This is a backwards compatible API change that fixes broken code.
      
      In Go 1.0, ReadFull(r, buf) could return either len(buf), nil or len(buf), non-nil.
      Most code expects only the former, so do that and document the guarantee.
      
      Code that was correct before is still correct.
      Code that was incorrect before, by assuming the guarantee, is now correct too.
      
      The same applies to ReadAtLeast.
      
      Fixes #4544.
      
      R=golang-dev, bradfitz, minux.ma
      CC=golang-dev
      https://golang.org/cl/7235074
      662ff542
  24. 13 Dec, 2012 1 commit
  25. 30 Oct, 2012 1 commit
  26. 08 Aug, 2012 1 commit
  27. 07 Aug, 2012 1 commit
  28. 08 Mar, 2012 1 commit
  29. 07 Mar, 2012 1 commit
  30. 01 Mar, 2012 1 commit
  31. 29 Feb, 2012 1 commit
  32. 06 Feb, 2012 1 commit
    • Rob Pike's avatar
      io: API tweaks · 929203ac
      Rob Pike authored
      - eliminate local Error type (a historical artifact)
      - fix documentation of CopyN
      - fix documentation of WriteString
      Fixes #2859.
      
      R=rsc, bradfitz
      CC=golang-dev
      https://golang.org/cl/5636046
      929203ac
  33. 02 Nov, 2011 1 commit
  34. 26 Oct, 2011 1 commit
  35. 30 Sep, 2011 1 commit
  36. 26 Aug, 2011 1 commit
  37. 28 Jun, 2011 1 commit
  38. 22 Jun, 2011 2 commits