1. 02 Nov, 2017 10 commits
  2. 01 Nov, 2017 27 commits
    • griesemer's avatar
      go/types: avoid repeated "declared but not used" errors for closure variables · a0dfd82f
      griesemer authored
      At the end of type-checking a function or closure, unused local variables
      are reported by looking at all variables in the function scope and its
      nested children scopes. If a nested scope belonged to a nested function
      (closure), that scope would be searched twice, leading to multiple error
      messages for unused variables.
      
      This CL introduces an internal-only marker to identify function scopes
      so that they can be ignored where needed.
      
      Fixes #22524.
      
      Change-Id: If58cc17b2f0615a16f33ea262f50dffd0e86d0f0
      Reviewed-on: https://go-review.googlesource.com/75251Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      a0dfd82f
    • Evan Jones's avatar
      syscall: use setattrlist for UtimesNano on Darwin for ns resolution · eb2b0ed5
      Evan Jones authored
      Mac OS X 10.13 introduced APFS which stores nanosecond resolution
      timestamps. The implementation of os.Stat already returns full
      resolution timestamps, but os.Chtimes only sets timestamps with
      microsecond resolution.
      
      Fix this by using setattrlist on Darwin, which takes a struct timeval
      with nanosecond resolution. This is what Mac OS X 10.13 appears uses
      to implement utimensat, according to dtruss.
      
      Fixes #22528
      
      Change-Id: I397dabef6b2b73a081382999aa4c4405ab8c6015
      Reviewed-on: https://go-review.googlesource.com/74952
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      eb2b0ed5
    • Ian Lance Taylor's avatar
      os: rearrange OpenFile Flags doc · 86b7721c
      Ian Lance Taylor authored
      Updates #21322
      
      Change-Id: Ib03ee9dbe1b44c2fecd51f2f2c23a88482158e7e
      Reviewed-on: https://go-review.googlesource.com/75250Reviewed-by: default avatarRob Pike <r@golang.org>
      86b7721c
    • Tom Bergan's avatar
      net/http: update bundled http2 · a8def0bb
      Tom Bergan authored
      Updates http2 to x/net/http2 git rev c73622c77280
      
      http2: always delay closing the connection after sending GOAWAY
      https://golang.org/cl/71372
      
      http2: Discard data reads on HEAD requests
      https://golang.org/cl/72551
      
      Fixes #18701
      Fixes #22376
      
      Change-Id: I2460cec64848992fff21790868b5fb8c91f050f2
      Reviewed-on: https://go-review.googlesource.com/75210
      Run-TryBot: Tom Bergan <tombergan@google.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a8def0bb
    • Tim Cooper's avatar
      crypto, hash: implement BinaryMarshaler, BinaryUnmarshaler in hash implementations · 731b6321
      Tim Cooper authored
      The marshal method allows the hash's internal state to be serialized and
      unmarshaled at a later time, without having the re-write the entire stream
      of data that was already written to the hash.
      
      Fixes #20573
      
      Change-Id: I40bbb84702ac4b7c5662f99bf943cdf4081203e5
      Reviewed-on: https://go-review.googlesource.com/66710Reviewed-by: default avatarJoe Tsai <thebrokentoaster@gmail.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      731b6321
    • Leigh McCulloch's avatar
      encoding/xml: ignore whitespace in values and attrs · 14bc4f5e
      Leigh McCulloch authored
      Whitespace is ignored in bool values and attrs. It is convenient and
      relatively safe since whitespace around a bool value is often
      unimportant. The same logic can be applied to numeric values of types
      int, uint, and float.
      
      Fixes #22146
      
      Change-Id: Ie0462def90304af144b8e2e72d85b644857c27cc
      Reviewed-on: https://go-review.googlesource.com/73891Reviewed-by: default avatarSam Whited <sam@samwhited.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Sam Whited <sam@samwhited.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      14bc4f5e
    • Leigh McCulloch's avatar
      encoding/xml: add docs and tests for bool whitespace · 776cdefc
      Leigh McCulloch authored
      Whitespace is ignored in bool values and attrs, but there are no tests
      capturing this behavior.
      
      Change-Id: I7a7249de4886f510869e91de937e69b83c3254c8
      Reviewed-on: https://go-review.googlesource.com/73890Reviewed-by: default avatarSam Whited <sam@samwhited.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Sam Whited <sam@samwhited.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      776cdefc
    • Mikio Hara's avatar
      net/smtp: don't call testing.T.Fatal{,f} from goroutines not running Test function · 541bf9f8
      Mikio Hara authored
      Also replaces verbs for error message from %s to %v. In general, low
      level IO APIs return an error value containing non-string types and
      there's no guarantee that all the types implement fmt.Stringer
      interface.
      
      Change-Id: I8a6e2a80d5c721c772a83b9556bac16556eaa771
      Reviewed-on: https://go-review.googlesource.com/73931
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      541bf9f8
    • Mikio Hara's avatar
      net/mail: capitalize acronym on helper function name · 0b7df655
      Mikio Hara authored
      Change-Id: Ibae06adcc69cae34cb0a14d990a0949b77fa772c
      Reviewed-on: https://go-review.googlesource.com/73930
      Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      0b7df655
    • Dmitri Shuralyov's avatar
      net/http: set Content-Type header for HEAD as well · 2ff75551
      Dmitri Shuralyov authored
      In CL 50510, the Content-Type header started to be set in Redirect when
      request method is GET. (Prior to that, it wasn't set at all, which is
      what said CL was fixing.) However, according to HTTP specification,
      the expected response for a HEAD request is identical to that of a
      GET request, but without the response body.
      
      This CL updates the behavior to set the Content-Type header for HEAD
      method in addition to GET.
      
      This actually allows a simpler implementation than before. This change
      largely reverts CL 50510, and applies the simpler implementation.
      
      Add a test for Content-Type header and body for GET, HEAD requests.
      
      Updates CL 50510.
      
      Change-Id: If33ea3f4bbc5246bb5dc751458004828cfe681b9
      Reviewed-on: https://go-review.googlesource.com/65190
      Run-TryBot: Dmitri Shuralyov <shurcool@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarEmmanuel Odeke <emm.odeke@gmail.com>
      Reviewed-by: default avatarTom Bergan <tombergan@google.com>
      2ff75551
    • Radek Sohlich's avatar
      os/signal: improve documentation for the Notify function · 66764cc5
      Radek Sohlich authored
      It is easy to miss the documentation information that no arguments
      in the Notify function means that the Notify will catch all possible signals.
      So the example was added with explicit comment above the Notify usage.
      
      Fixes #22257
      
      Change-Id: Ia6a16dd4a419f7c77d89020ca5db85979b5b474e
      Reviewed-on: https://go-review.googlesource.com/74730
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      66764cc5
    • Cherry Zhang's avatar
      cmd/internal/goobj: accept int64 in readInt · 7bd0b610
      Cherry Zhang authored
      The counter part, writeInt in cmd/internal/obj, writes int64s.
      So the reader side should also read int64s. This may cause a
      larger range of values being accepted, some of which should
      not be that large. This is probably ok: for example, for
      size/index/length, the very large value (due to corruption)
      may be well past the end and causes other errors. And we did
      not do much bound check anyway.
      
      One exmaple where this matters is ARM32's object file. For one
      type of relocation it encodes the instruction into Reloc.Add
      field (which itself may be problematic and worth fix) and the
      instruction encoding overflows int32, causing ARM32 object
      file being rejected by goobj (and so objdump and nm) before.
      
      Unskip ARM32 object file tests in goobj, nm, and objdump.
      
      Updates #19811.
      
      Change-Id: Ia46c2b68df5f1c5204d6509ceab6416ad6372315
      Reviewed-on: https://go-review.googlesource.com/69010
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      7bd0b610
    • griesemer's avatar
      math/big: implement CmpAbs · 85c32c37
      griesemer authored
      Fixes #22473.
      
      Change-Id: Ie886dfc8b5510970d6d63ca6472c73325f6f2276
      Reviewed-on: https://go-review.googlesource.com/74971
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
      85c32c37
    • Daniel Martí's avatar
      go/types: sort unused declaration errors · 18525735
      Daniel Martí authored
      By position, to ensure deterministic output.
      
      Fixes #22525.
      
      Change-Id: I28777d504a622416678b52afd6fc4c3ef32c12af
      Reviewed-on: https://go-review.googlesource.com/75090
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      18525735
    • Alberto Donizetti's avatar
      math/big: avoid unnecessary Newton iteration in Float.Sqrt · 856dccb1
      Alberto Donizetti authored
      An initial draft of the Newton code for Float.Sqrt was structured like
      this:
      
        for condition
          // do Newton iteration..
          prec *= 2
      
      since prec, at the end of the loop, was double the precision used in
      the last Newton iteration, the termination condition was set to
      2*limit. The code was later rewritten in the form
      
        for condition
          prec *= 2
          // do Newton iteration..
      
      but condition was not updated, and it's still 2*limit, which is about
      double what we actually need, and is triggering the execution of an
      additional, and unnecessary, Newton iteration.
      
      This change adjusts the Newton termination condition to the (correct)
      value of z.prec, plus 32 guard bits as a safety margin.
      
      name                 old time/op    new time/op    delta
      FloatSqrt/64-4          798ns ± 3%     802ns ± 3%     ~     (p=0.458 n=8+8)
      FloatSqrt/128-4        1.65µs ± 1%    1.65µs ± 1%     ~     (p=0.290 n=8+8)
      FloatSqrt/256-4        3.10µs ± 1%    2.10µs ± 0%  -32.32%  (p=0.000 n=8+7)
      FloatSqrt/1000-4       8.83µs ± 1%    4.91µs ± 2%  -44.39%  (p=0.000 n=8+8)
      FloatSqrt/10000-4       107µs ± 1%      40µs ± 1%  -62.68%  (p=0.000 n=8+8)
      FloatSqrt/100000-4     2.91ms ± 1%    0.96ms ± 1%  -67.13%  (p=0.000 n=8+8)
      FloatSqrt/1000000-4     240ms ± 1%      80ms ± 1%  -66.66%  (p=0.000 n=8+8)
      
      name                 old alloc/op   new alloc/op   delta
      FloatSqrt/64-4           416B ± 0%      416B ± 0%     ~     (all equal)
      FloatSqrt/128-4          720B ± 0%      720B ± 0%     ~     (all equal)
      FloatSqrt/256-4        1.34kB ± 0%    0.82kB ± 0%  -39.29%  (p=0.000 n=8+8)
      FloatSqrt/1000-4       5.09kB ± 0%    2.50kB ± 0%  -50.94%  (p=0.000 n=8+8)
      FloatSqrt/10000-4      45.9kB ± 0%    23.5kB ± 0%  -48.81%  (p=0.000 n=8+8)
      FloatSqrt/100000-4      533kB ± 0%     251kB ± 0%  -52.90%  (p=0.000 n=8+8)
      FloatSqrt/1000000-4    9.21MB ± 0%    4.61MB ± 0%  -49.98%  (p=0.000 n=8+8)
      
      name                 old allocs/op  new allocs/op  delta
      FloatSqrt/64-4           9.00 ± 0%      9.00 ± 0%     ~     (all equal)
      FloatSqrt/128-4          13.0 ± 0%      13.0 ± 0%     ~     (all equal)
      FloatSqrt/256-4          15.0 ± 0%      12.0 ± 0%  -20.00%  (p=0.000 n=8+8)
      FloatSqrt/1000-4         24.0 ± 0%      19.0 ± 0%  -20.83%  (p=0.000 n=8+8)
      FloatSqrt/10000-4        40.0 ± 0%      35.0 ± 0%  -12.50%  (p=0.000 n=8+8)
      FloatSqrt/100000-4       66.0 ± 0%      55.0 ± 0%  -16.67%  (p=0.000 n=8+8)
      FloatSqrt/1000000-4       143 ± 0%       122 ± 0%  -14.69%  (p=0.000 n=8+8)
      
      Change-Id: I4868adb7f8960f2ca20e7792734c2e6211669fc0
      Reviewed-on: https://go-review.googlesource.com/75010Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      856dccb1
    • Joe Kyo's avatar
      net/http: fix typo in doc string · a6b0a1c0
      Joe Kyo authored
      Change-Id: I4542f6c095a35a4dec03c67c45a75a155197eb56
      Reviewed-on: https://go-review.googlesource.com/74650Reviewed-by: default avatarTom Bergan <tombergan@google.com>
      a6b0a1c0
    • David Chase's avatar
      cmd/compile: provide more names for stack slots · a0348090
      David Chase authored
      Recurse into structs/arrays of one element when
      assigning names.
      
      Test incorporated into existing end-to-end debugger test,
      hand-verified that it fails without this CL.
      
      Fixes #19868
      
      Revives CL 40010
      Old-Change-Id: I0266e58af975fb64cfa17922be383b70f0a7ea96
      
      Change-Id: I122ac2375931477769ec8d763607c1ec42d78a7f
      Reviewed-on: https://go-review.googlesource.com/71731
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: default avatarHeschi Kreinick <heschi@google.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      a0348090
    • Alessandro Arzilli's avatar
      compile, link: remove base address selector from DWARF range lists · 018642d6
      Alessandro Arzilli authored
      Dsymutil, an utility used on macOS when externally linking executables,
      does not support base address selector entries in debug_ranges.
      
      To work around this deficiency this commit removes base address
      selectors from debug_ranges and emits instead a list composed only of
      compile unit relative addresses.
      
      A new type of relocation is introduced, R_ADDRCUOFF, similar to
      R_ADDROFF, that relocates an address to its offset from the low_pc of
      the symbol's compile unit.
      
      Fixes #21945
      
      Change-Id: Ie991f9bc1afda2b49ac5d734eb41c37d3a37e554
      Reviewed-on: https://go-review.googlesource.com/72371
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      Reviewed-by: default avatarHeschi Kreinick <heschi@google.com>
      018642d6
    • Russ Cox's avatar
      cmd/go: pass package config to vet during "go vet" · 56178649
      Russ Cox authored
      After this CL, "go vet" can be guaranteed to have complete type information
      about the packages being checked, even if cgo or swig is in use,
      which will in turn make it reasonable for vet checks to insist on type
      information. It also fixes vet's understanding of unusual import paths
      like relative paths and vendored packages.
      
      For now "go tool vet" will continue to cope without type information,
      but the eventual plan is for "go tool vet" to query the go command for
      what it needs, and also to be able to query alternate build systems
      like bazel. But that's future work.
      
      Fixes #4889.
      Fixes #12556 (if not already fixed).
      Fixes #15182.
      Fixes #16086.
      Fixes #17571.
      
      Change-Id: I932626ee7da649b302cd269b82eb6fe5d7b9f0f2
      Reviewed-on: https://go-review.googlesource.com/74750Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      56178649
    • Russ Cox's avatar
      cmd/vet: accept package config from go command · 4fe42799
      Russ Cox authored
      This CL adds support for accepting package config from
      the go command. Paired with CL 74356 this lets us make
      sure vet has complete information about package sources.
      This fixes many issues (see CL 74356 for the list), including
      mishandling of cgo and vendoring.
      
      Change-Id: Ia4a1dce6f9b1b0a8ef5fdf9005a20a8b294969f1
      Reviewed-on: https://go-review.googlesource.com/74355
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarRob Pike <r@golang.org>
      4fe42799
    • Filippo Valsorda's avatar
      make.bash: show correct GOROOT_BOOTSTRAP when using `go env GOROOT` · f1fa663b
      Filippo Valsorda authored
      Also, support spaces in go binaries locations, and document
      GOROOT_BOOTSTRAP at the top.
      
      Change-Id: I643d22df57aad9a2200cc256edd20e8c811bc70d
      Reviewed-on: https://go-review.googlesource.com/74951
      Run-TryBot: Filippo Valsorda <hi@filippo.io>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      f1fa663b
    • Martin Möhrmann's avatar
      runtime: protect growslice against newcap*et.size overflow · 371a5b49
      Martin Möhrmann authored
      The check of uintptr(newcap) > maxSliceCap(et.size) in addition
      to capmem > _MaxMem is needed to prevent a reproducible overflow
      on 32bit architectures.
      
      On 64bit platforms this problem is less likely to occur as allocation
      of a sufficiently large array or slice to be append is likely to
      already exhaust available memory before the call to append can be made.
      
      Example program that without the fix in this CL does segfault on 386:
      
      type T [1<<27 + 1]int64
      
      var d T
      var s []T
      
      func main() {
              s = append(s, d, d, d, d)
              print(len(s), "\n")
      }
      
      Fixes #21586
      
      Change-Id: Ib4185435826ef43df71ba0f789e19f5bf9a347e6
      Reviewed-on: https://go-review.googlesource.com/55133
      Run-TryBot: Martin Möhrmann <moehrmann@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      371a5b49
    • Tobias Klauser's avatar
      all: remove unnecessary return after skipping test · 96c62b3b
      Tobias Klauser authored
      testing.Skip{,f} will exit the test via runtime.Goexit. Thus, the
      successive return is never reached and can be removed.
      
      Change-Id: I1e399f3d5db753ece1ffba648850427e1b4be300
      Reviewed-on: https://go-review.googlesource.com/74990
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDaniel Martí <mvdan@mvdan.cc>
      96c62b3b
    • Alberto Donizetti's avatar
      math/big: save one subtraction per iteration in Float.Sqrt · 2c783dc0
      Alberto Donizetti authored
      The Sqrt Newton method computes g(t) = f(t)/f'(t) and then iterates
      
        t2 = t1 - g(t1)
      
      We can save one operation by including the final subtraction in g(t)
      and evaluating the resulting expression symbolically.
      
      For example, for the direct method,
      
        g(t) = ½(t² - x)/t
      
      and we use 2 multiplications, 1 division and 1 subtraction in g(),
      plus 1 final subtraction; but if we compute
      
        t - g(t) = t - ½(t² - x)/t = ½(t² + x)/t
      
      we only use 2 multiplications, 1 division and 1 addition.
      
      A similar simplification can be done for the inverse method.
      
      name                 old time/op    new time/op    delta
      FloatSqrt/64-4          889ns ± 4%     790ns ± 1%  -11.19%  (p=0.000 n=8+7)
      FloatSqrt/128-4        1.82µs ± 0%    1.64µs ± 1%  -10.07%  (p=0.001 n=6+8)
      FloatSqrt/256-4        3.56µs ± 4%    3.10µs ± 3%  -12.96%  (p=0.000 n=7+8)
      FloatSqrt/1000-4       9.06µs ± 3%    8.86µs ± 1%   -2.20%  (p=0.001 n=7+7)
      FloatSqrt/10000-4       109µs ± 1%     107µs ± 1%   -1.56%  (p=0.000 n=8+8)
      FloatSqrt/100000-4     2.91ms ± 0%    2.89ms ± 2%   -0.68%  (p=0.026 n=7+7)
      FloatSqrt/1000000-4     237ms ± 1%     239ms ± 1%   +0.72%  (p=0.021 n=8+8)
      
      name                 old alloc/op   new alloc/op   delta
      FloatSqrt/64-4           448B ± 0%      416B ± 0%   -7.14%  (p=0.000 n=8+8)
      FloatSqrt/128-4          752B ± 0%      720B ± 0%   -4.26%  (p=0.000 n=8+8)
      FloatSqrt/256-4        2.05kB ± 0%    1.34kB ± 0%  -34.38%  (p=0.000 n=8+8)
      FloatSqrt/1000-4       6.91kB ± 0%    5.09kB ± 0%  -26.39%  (p=0.000 n=8+8)
      FloatSqrt/10000-4      60.5kB ± 0%    45.9kB ± 0%  -24.17%  (p=0.000 n=8+8)
      FloatSqrt/100000-4      617kB ± 0%     533kB ± 0%  -13.57%  (p=0.000 n=8+8)
      FloatSqrt/1000000-4    10.3MB ± 0%     9.2MB ± 0%  -10.85%  (p=0.000 n=8+8)
      
      name                 old allocs/op  new allocs/op  delta
      FloatSqrt/64-4           9.00 ± 0%      9.00 ± 0%     ~     (all equal)
      FloatSqrt/128-4          13.0 ± 0%      13.0 ± 0%     ~     (all equal)
      FloatSqrt/256-4          20.0 ± 0%      15.0 ± 0%  -25.00%  (p=0.000 n=8+8)
      FloatSqrt/1000-4         31.0 ± 0%      24.0 ± 0%  -22.58%  (p=0.000 n=8+8)
      FloatSqrt/10000-4        50.0 ± 0%      40.0 ± 0%  -20.00%  (p=0.000 n=8+8)
      FloatSqrt/100000-4       76.0 ± 0%      66.0 ± 0%  -13.16%  (p=0.000 n=8+8)
      FloatSqrt/1000000-4       146 ± 0%       143 ± 0%   -2.05%  (p=0.000 n=8+8)
      
      Change-Id: I271c00de1ca9740e585bf2af7bcd87b18c1fa68e
      Reviewed-on: https://go-review.googlesource.com/73879
      Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      2c783dc0
    • Tobias Klauser's avatar
      cmd/cgo: remove unnecessary nil check · 235a25c3
      Tobias Klauser authored
      commentText is only called if g != nil in ParseGo, so the check inside
      commentText is redundant and can be deleted.
      
      Change-Id: I130c18b738527c96bc59950b354a50b9e23f92e9
      Reviewed-on: https://go-review.googlesource.com/74871
      Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      235a25c3
    • Carl Mastrangelo's avatar
      archive/zip, crypto/tls: use rand.Read instead of casting ints to bytes · f265f5db
      Carl Mastrangelo authored
      Makes tests run ~1ms faster.
      
      Change-Id: Ida509952469540280996d2bd9266724829e53c91
      Reviewed-on: https://go-review.googlesource.com/47359Reviewed-by: default avatarFilippo Valsorda <hi@filippo.io>
      Run-TryBot: Filippo Valsorda <hi@filippo.io>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f265f5db
    • Ian Lance Taylor's avatar
      time: improve comments about valid layouts being invalid Parse values · fb1fd6ae
      Ian Lance Taylor authored
      Updates #9346
      Updates #22135
      
      Change-Id: I7039c9f7d49600e877e35b7255c341fea35890e2
      Reviewed-on: https://go-review.googlesource.com/74890Reviewed-by: default avatarRob Pike <r@golang.org>
      fb1fd6ae
  3. 31 Oct, 2017 3 commits