1. 14 Mar, 2019 13 commits
  2. 13 Mar, 2019 22 commits
  3. 12 Mar, 2019 5 commits
    • Robert Griesemer's avatar
      cmd/compile: don't report redundant error for invalid integer literals · bea58ef3
      Robert Griesemer authored
      Fixes #30722.
      
      Change-Id: Ia4c6e37282edc44788cd8af3f6cfa10895a19e4f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166519Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      bea58ef3
    • Robert Griesemer's avatar
      cmd/compile: remove work-arounds for handling underscores in numbers · fbc5acbd
      Robert Griesemer authored
      With math/big supporting underscores directly, there is no need to
      manually remove them before calling the math/big conversion routines.
      
      Updates #28493.
      
      Change-Id: I6f865c8f87c3469ffd6c33f960ed540135055226
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166417Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      fbc5acbd
    • Robert Griesemer's avatar
      math/big: add support for underscores '_' in numbers · cfa93ba5
      Robert Griesemer authored
      The primary change is in nat.scan which now accepts underscores for base 0.
      While at it, streamlined error handling in that function as well.
      Also, improved the corresponding test significantly by checking the
      expected result values also in case of scan errors.
      
      The second major change is in scanExponent which now accepts underscores when
      the new sepOk argument is set. While at it, essentially rewrote that
      function to match error and underscore handling of nat.scan more closely.
      Added a new test for scanExponent which until now was only tested
      indirectly.
      
      Finally, updated the documentation for several functions and added many
      new test cases to clients of nat.scan.
      
      A major portion of this CL is due to much better test coverage.
      
      Updates #28493.
      
      Change-Id: I7f17b361b633fbe6c798619d891bd5e0a045b5c5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166157Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
      cfa93ba5
    • Daniel Martí's avatar
      text/tabwriter: use a single defer per Write call · c4078a19
      Daniel Martí authored
      Lines with single cells prompt a flush. Unfortunately, a call to
      Writer.Flush also means two defers, which is an expensive operation to
      do if many lines consist of single cells.
      
      This is common when formatting code with aligned comments. Most lines
      aren't going to have any comments at all, so the performance hit is
      going to be noticeable.
      
      The Write method already has a "defer handlePanic" of its own, so we
      don't need to worry about panics leaking out. The error will now mention
      "Write" instead of "Flush" if a panic is encountered during that nested
      flush, but arguably that's a good thing; the user called Write, not
      Flush.
      
      For the reset call, add a non-deferred call as part of flushNoDefers, as
      that's still necessary. Otherwise, the exported Flush method still does
      a "defer b.reset".
      
      The current tabwriter benchmarks are unaffected, since they don't
      contain many single-cell lines, and because lines are written one at a
      time. For that reason, we add a benchmark which has both of these
      characteristics.
      
      name    old time/op    new time/op    delta
      Code-8    2.72µs ± 0%    1.77µs ± 0%  -34.88%  (p=0.000 n=6+5)
      
      name    old alloc/op   new alloc/op   delta
      Code-8      648B ± 0%      648B ± 0%     ~     (all equal)
      
      name    old allocs/op  new allocs/op  delta
      Code-8      13.0 ± 0%      13.0 ± 0%     ~     (all equal)
      
      Perhaps unsurprisingly, go/printer also gets a bit faster, as it too
      buffers its output before writing it to tabwriter.
      
      name     old time/op  new time/op  delta
      Print-8  6.53ms ± 0%  6.39ms ± 0%  -2.22%  (p=0.008 n=5+5)
      
      Change-Id: Ie01fea5ced43886a9eb796cb1e6c810f7a810853
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166797
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      c4078a19
    • Bryan C. Mills's avatar
      cmd/go: fix typo in GoGetInsecure to actually set GOPROXY · 01d1dc41
      Bryan C. Mills authored
      I typo'd this variable in CL 165745, and neither I, the reviewer, nor the TryBots noticed.
      But the longtest builder noticed, and it's not happy about it.
      
      Updates #30571
      
      Change-Id: I5e3d267346407855ec0d1f340a72dc2c521ecc63
      Reviewed-on: https://go-review.googlesource.com/c/go/+/167086
      Run-TryBot: Bryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      01d1dc41