1. 01 Oct, 2015 2 commits
  2. 30 Sep, 2015 10 commits
  3. 29 Sep, 2015 9 commits
  4. 28 Sep, 2015 7 commits
    • Andrew Gerrand's avatar
      doc: add text/template blocks and redefinition to go1.6.txt · 652d2386
      Andrew Gerrand authored
      Change-Id: Ide82ac98dc7cb1035ceb9d461ed95af899f8f983
      Reviewed-on: https://go-review.googlesource.com/15081Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
      652d2386
    • Robert Griesemer's avatar
      encoding/json: document that encoding.TextMarshaler is used if no (json) Marshaler is present · cbe8a353
      Robert Griesemer authored
      Change-Id: I63da54832548c325e47dc54aaa5b5112e1f3b3ba
      Reviewed-on: https://go-review.googlesource.com/15048Reviewed-by: 's avatarRob Pike <r@golang.org>
      cbe8a353
    • Robert Griesemer's avatar
      math/big: improved documentation · 3d4cd144
      Robert Griesemer authored
      - moved existing package documentation from nat.go to doc.go
      - expanded on it
      
      For #11241.
      
      Change-Id: Ie75a2b0178a8904a4154307a1f5080d7efc5489a
      Reviewed-on: https://go-review.googlesource.com/15042Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      3d4cd144
    • Rob Pike's avatar
      cmd/doc: rearrange the newlines to group better · c978f13a
      Rob Pike authored
      Main change is that the comment for an item no longer has a blank line
      before it, so it looks bound to the item it's about.
      
      Motivating example: go doc.io.read changes from
      
      <
      func (l *LimitedReader) Read(p []byte) (n int, err error)
      func (r *PipeReader) Read(data []byte) (n int, err error)
      
          Read implements the standard Read interface: it reads data from the pipe,
          blocking until a writer arrives or the write end is closed. If the write end
          is closed with an error, that error is returned as err; otherwise err is
          EOF.
      func (s *SectionReader) Read(p []byte) (n int, err error)
      >
      
      to
      
      <
      func (l *LimitedReader) Read(p []byte) (n int, err error)
      func (r *PipeReader) Read(data []byte) (n int, err error)
          Read implements the standard Read interface: it reads data from the pipe,
          blocking until a writer arrives or the write end is closed. If the write end
          is closed with an error, that error is returned as err; otherwise err is
          EOF.
      
      func (s *SectionReader) Read(p []byte) (n int, err error)
      >
      
      Now the comment about PipeReader.Read doesn't look like it's about
      SectionReader.
      
      Based on a suggestion by dsnet@, a slight tweak from a CL he suggested
      and abandoned.
      
      Fixes #12756,
      
      Change-Id: Iaf60ee9ae7f644c83c32d5e130acab0312b0c926
      Reviewed-on: https://go-review.googlesource.com/14999Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
      c978f13a
    • Andrew Gerrand's avatar
      text/template, html/template: add block keyword and permit template redefinition · 12dfc3be
      Andrew Gerrand authored
      This change adds a new "block" keyword that permits the definition
      of templates inline inside existing templates, and loosens the
      restriction on template redefinition. Templates may now be redefined,
      but in the html/template package they may only be redefined before
      the template is executed (and therefore escaped).
      
      The intention is that such inline templates can be redefined by
      subsequent template definitions, permitting a kind of template
      "inheritance" or "overlay". (See the example for details.)
      
      Fixes #3812
      
      Change-Id: I733cb5332c1c201c235f759cc64333462e70dc27
      Reviewed-on: https://go-review.googlesource.com/14005Reviewed-by: 's avatarRob Pike <r@golang.org>
      12dfc3be
    • Ian Lance Taylor's avatar
      cmd/cgo: only declare real function in gccgo exported header file · 09c6d13a
      Ian Lance Taylor authored
      When exporting a function using gccgo, we generate two functions: a Go
      function with a leading Cgoexp_ prefix, and a C function that calls the
      Go function.  The Go function has a name that can not be represented in
      C, so the C code needs a declaration with an __asm__ qualifier giving
      the name of the Go function.
      
      Before this CL we put that declaration in the exported header file.
      Because code would sometimes #include "_cgo_export.h", we added a macro
      definition for the C function giving it the name of the declaration.  We
      then added a macro undefine in the actual C code, so that we could
      declare the C function we wanted.
      
      This rounadabout process worked OK until we started exporting the header
      file for use with -buildmode=c-archive and c-shared.  Doing that caused
      the code to see the define and thus call the Go function rather than the
      C function.  That often works fine, but the C function calls
      _cgo_wait_runtime_init_done before calling the Go function, and that
      sometimes matters.  This didn't show up in tests because we don't test
      using gccgo.  That is something we should fix, but not now.
      
      Fix that by simplifying the code to declare the C function in the header
      file as one would expect, and move the __asm__ declaration to the C
      code.
      
      Change-Id: I33547e028152ff98e332630994b4f33285feec32
      Reviewed-on: https://go-review.googlesource.com/15043Reviewed-by: 's avatarMinux Ma <minux@golang.org>
      09c6d13a
    • Joel Sing's avatar
      tests/fixedbugs: make test for issue11656 run known instruction · 82a9d90e
      Joel Sing authored
      As detailed in #11910, the current implementation attempts to execute an area
      of memory with unknown content. If the memory is executable, the result is
      unpredictable - instead, make the test deterministic by attempting to execute
      an instruction that is known to trigger a trap on the given architecture.
      
      The new implementation is written by iant@ and provided via #11910.
      
      Update issue #11910
      
      Change-Id: Ia698c36e0dd98a9d9d16a701f60f6748c6faf896
      Reviewed-on: https://go-review.googlesource.com/15058
      Run-TryBot: Joel Sing <jsing@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      82a9d90e
  5. 27 Sep, 2015 2 commits
  6. 25 Sep, 2015 8 commits
  7. 24 Sep, 2015 2 commits
    • Robert Griesemer's avatar
      math/big: faster string conversion routines · b07a9efa
      Robert Griesemer authored
      Eliminated unnecessary string conversions throughout and removed
      (internal) capability for arbitrary character sets in conversion
      routines (functionality was not exported and not used internally).
      
      benchmark                         old ns/op     new ns/op     delta
      BenchmarkDecimalConversion-8      198283        187085        -5.65%
      BenchmarkStringPiParallel-8       46116         47822         +3.70%
      BenchmarkString10Base2-8          216           166           -23.15%
      BenchmarkString100Base2-8         886           762           -14.00%
      BenchmarkString1000Base2-8        7296          6625          -9.20%
      BenchmarkString10000Base2-8       72371         65563         -9.41%
      BenchmarkString100000Base2-8      725849        672766        -7.31%
      BenchmarkString10Base8-8          160           114           -28.75%
      BenchmarkString100Base8-8         398           309           -22.36%
      BenchmarkString1000Base8-8        2650          2244          -15.32%
      BenchmarkString10000Base8-8       24974         21745         -12.93%
      BenchmarkString100000Base8-8      245457        217489        -11.39%
      BenchmarkString10Base10-8         337           288           -14.54%
      BenchmarkString100Base10-8        1298          1046          -19.41%
      BenchmarkString1000Base10-8       6200          5752          -7.23%
      BenchmarkString10000Base10-8      24942         22589         -9.43%
      BenchmarkString100000Base10-8     8012921       7947152       -0.82%
      BenchmarkString10Base16-8         156           107           -31.41%
      BenchmarkString100Base16-8        344           255           -25.87%
      BenchmarkString1000Base16-8       2067          1705          -17.51%
      BenchmarkString10000Base16-8      19026         16112         -15.32%
      BenchmarkString100000Base16-8     184038        163457        -11.18%
      
      Change-Id: I68bd807529bd9b985f4b6ac2a87764bcc1a7d2f7
      Reviewed-on: https://go-review.googlesource.com/14926Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      b07a9efa
    • Rob Pike's avatar
      cmd/doc: don't stop after first package if the symbol is not found · 007fa019
      Rob Pike authored
      The test case is
      	go doc rand.Float64
      The first package it finds is crypto/rand, which does not have a Float64.
      Before this change, cmd/doc would stop there even though math/rand
      has the symbol. After this change, we get:
      
      	% go doc rand.Float64
      	package rand // import "math/rand"
      
      	func Float64() float64
      
      	    Float64 returns, as a float64, a pseudo-random number in [0.0,1.0) from the
      	    default Source.
      	%
      
      Another nice consequence is that if a symbol is not found, we might get
      a longer list of packages that were examined:
      
      	% go doc rand.Int64
      	doc: no symbol Int64 in packages crypto/rand, math/rand
      	exit status 1
      	%
      
      This change introduces a coroutine to scan the file system so that if
      the symbol is not found, the coroutine can deliver another path to try.
      (This is darned close to the original motivation for coroutines.)
      Paths are delivered on an unbuffered channel so the scanner does
      not proceed until candidate paths are needed.
      
      The scanner is attached to a new type, called Dirs, that caches the results
      so if we need to scan a second time, we don't walk the file system
      again. This is significantly more efficient than the existing code, which
      could scan the tree multiple times looking for a package with
      the symbol.
      
      Change-Id: I2789505b9992cf04c19376c51ae09af3bc305f7f
      Reviewed-on: https://go-review.googlesource.com/14921Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
      007fa019