1. 05 Dec, 2018 17 commits
  2. 04 Dec, 2018 14 commits
  3. 03 Dec, 2018 9 commits
    • Ian Lance Taylor's avatar
      misc/cgo/testcshared: skip TestGo2C2Go on Android · 58ffe505
      Ian Lance Taylor authored
      Updates #29087
      
      Change-Id: I0bab45818119176c2ba5de9c0e457b7717485d6f
      Reviewed-on: https://go-review.googlesource.com/c/152162
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      58ffe505
    • Robert Griesemer's avatar
      go/types: fix interface receiver type for incremental type-checking · 13e40c76
      Robert Griesemer authored
      The type checker may be called incrementally (by repeatedly calling
      Checker.Files), for instance when adding _test.go files to a set of
      already checked files.
      
      The existing code reset a cache of (already computed) interface
      information with each Checker.Files call, causing interfaces to be
      recomputed in some cases, albeit with different receiver information
      (see comments in this CL for details).
      
      Don't reset the interface cache to avoid this problem.
      
      While adding a test case, also factor out some common testing logic.
      
      Fixes #29029.
      
      Change-Id: I2e2d6d6bb839b3a76522fbc4ba7355c71d3bb80b
      Reviewed-on: https://go-review.googlesource.com/c/152259Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      13e40c76
    • SALLEYRON Julien's avatar
      net/http/httputil: fix unannounced trailers when body is empty · 48399cae
      SALLEYRON Julien authored
      Fix unannounced trailers when body is empty and without announced trailers.
      
      Fixes #29031
      
      Change-Id: If49951a42fe56d4be4436a999627db4c2678659d
      GitHub-Last-Rev: 3469adc8f5fd977438350274134950687853a468
      GitHub-Pull-Request: golang/go#29032
      Reviewed-on: https://go-review.googlesource.com/c/151898
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      48399cae
    • Daniel Martí's avatar
      cmd/vendor: update to golang.org/x/tools@e5f3ab76 · a48a15cd
      Daniel Martí authored
      To pull in the fix for #28858, which we want to include for Go 1.12.
      
      Fixes #28858.
      
      Change-Id: Id4964cfd38e3d44d6317a2ee124fe2d35038b5fd
      Reviewed-on: https://go-review.googlesource.com/c/152277
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      a48a15cd
    • Ian Lance Taylor's avatar
      cmd/cgo: use a plausible position for typedef error messages · 54cbc5b4
      Ian Lance Taylor authored
      Fixes #28069
      
      Change-Id: I7e0f96b8b6d123de283325fcb78ec76455050f6d
      Reviewed-on: https://go-review.googlesource.com/c/152158
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      54cbc5b4
    • Brad Fitzpatrick's avatar
      net/http: document CanonicalHeaderKey from Header · f98081e5
      Brad Fitzpatrick authored
      And remove some unnecessary textproto references. (The net/http
      package's CanonicalHeaderKey just calls textproto's
      CanonicalMIMEHeaderKey)
      
      Fixes #28894
      
      Change-Id: Ibd277893a168368c593147a2677ad6130870cb88
      Reviewed-on: https://go-review.googlesource.com/c/152157Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      f98081e5
    • Ian Lance Taylor's avatar
      misc/cgo/testcshared: don't run TestGo2C2Go on Darwin · cef41e0d
      Ian Lance Taylor authored
      Darwin doesn't support the multiple copies of the runtime package
      implied by linking a c-shared library into a Go program.
      
      Updates #29061
      
      Change-Id: I6cf5d00babf82f1de05689c1345aaa5ae0b0659c
      Reviewed-on: https://go-review.googlesource.com/c/152159
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      cef41e0d
    • Keith Randall's avatar
      cmd/compile: fix static initializer · 4a1a783d
      Keith Randall authored
      staticcopy of a struct or array should recursively call itself, not
      staticassign.
      
      This fixes an issue where a struct with a slice in it is copied during
      static initialization. In this case, the backing array for the slice
      is duplicated, and each copy of the slice refers to a different
      backing array, which is incorrect.  That issue has existed since at
      least Go 1.2.
      
      I'm not sure why this was never noticed. It seems like a pretty
      obvious bug if anyone modifies the resulting slice.
      
      In any case, we started to notice when the optimization in CL 140301
      landed.  Here is basically what happens in issue29013b.go:
      1) The error above happens, so we get two backing stores for what
         should be the same slice.
      2) The code for initializing those backing stores is reused.
         But not duplicated: they are the same Node structure.
      3) The order pass allocates temporaries for the map operations.
         For the first instance, things work fine and two temporaries are
         allocated and stored in the OKEY nodes. For the second instance,
         the order pass decides new temporaries aren't needed, because
         the OKEY nodes already have temporaries in them.
         But the order pass also puts a VARKILL of the temporaries between
         the two instance initializations.
      4) In this state, the code is technically incorrect. But before
         CL 140301 it happens to work because the temporaries are still
         correctly initialized when they are used for the second time. But then...
      5) The new CL 140301 sees the VARKILLs and decides to reuse the
         temporary for instance 1 map 2 to initialize the instance 2 map 1
         map. Because the keys aren't re-initialized, instance 2 map 1
         gets the wrong key inserted into it.
      
      Fixes #29013
      
      Change-Id: I840ce1b297d119caa706acd90e1517a5e47e9848
      Reviewed-on: https://go-review.googlesource.com/c/152081
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      4a1a783d
    • Carlo Alberto Ferraris's avatar
      net: enable TCP keepalives by default · 5bd7e9c5
      Carlo Alberto Ferraris authored
      This is just the first step in attempting to make all network connection have
      timeouts as a "safe default". TCP keepalives only protect against certain
      classes of network and host issues (e.g. server/OS crash), but do nothing
      against application-level issues (e.g. an application that accepts connections
      but then fails to serve requests).
      
      The actual keep-alive duration (15s) is chosen to cause broken connections
      to be closed after 2~3 minutes (depending on the OS, see #23549 for details).
      We don't make the actual default value part of the public API for a number of
      reasons:
      - because it's not very useful by itself: as discussed in #23549 the actual
        "timeout" after which the connection is torn down is duration*(KEEPCNT+1),
        and we use the OS-wide value for KEEPCNT because there's currently no way
        to set it from Go.
      - because it may change in the future: if users need to rely on a specific
        value they should explicitly set this value instead of relying on the default.
      
      Fixes #23459
      
      Change-Id: I348c03be97588d5001e6de0f377e7a93b51957fd
      Reviewed-on: https://go-review.googlesource.com/c/107196
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      5bd7e9c5