1. 30 Jun, 2018 1 commit
  2. 29 Jun, 2018 16 commits
  3. 28 Jun, 2018 10 commits
  4. 27 Jun, 2018 13 commits
    • Hiroshi Ioka's avatar
      go/doc: make examples that depend on top-level decls playable · 11f1fab4
      Hiroshi Ioka authored
      Currently, the following example cannot run in playground:
      
          func a() {
              fmt.Println("A")
          }
      
          func ExampleA() {
              a()
          }
      
      This CL solves it.
      
      Fixes #23095
      
      Change-Id: I5a492ff886a743f20cb4ae646e8453bde9c5f0da
      Reviewed-on: https://go-review.googlesource.com/83615
      Run-TryBot: Robert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      11f1fab4
    • Peter Wu's avatar
      crypto/tls: add RSASSA-PSS support for handshake messages · 87867505
      Peter Wu authored
      This adds support for RSASSA-PSS signatures in handshake messages as
      required by TLS 1.3. Even if TLS 1.2 is negotiated, it must support PSS
      when advertised in the Client Hello (this will be done later as the
      testdata will change).
      
      Updates #9671
      
      Change-Id: I8006b92e017453ae408c153233ce5ccef99b5c3f
      Reviewed-on: https://go-review.googlesource.com/79736Reviewed-by: default avatarFilippo Valsorda <filippo@golang.org>
      87867505
    • Ian Lance Taylor's avatar
      os: when looping in RemoveAll, close and re-open directory · a6a69227
      Ian Lance Taylor authored
      On some systems removing files can cause a directory to be re-shuffled,
      so simply continuing to read files can cause us to miss some.
      Close and re-open the directory when looping, to avoid that.
      
      Read more files each time through the loop, to reduce the chance of
      having to re-open.
      
      Fixes #20841
      
      Change-Id: I98a14774ca63786ad05ba5000cbdb01ad2884332
      Reviewed-on: https://go-review.googlesource.com/121255
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      a6a69227
    • Ian Lance Taylor's avatar
      reflect: prevent additional StructOf embedded method cases · 83092a40
      Ian Lance Taylor authored
      The current implementation does not generate wrappers for methods of
      embedded non-interface types. We can only skip the wrapper if
      kindDirectIface of the generated struct type matches kindDirectIface
      of the embedded type. Panic if that is not the case.
      
      It would be better to actually generate wrappers, but that can be done
      later.
      
      Updates #15924
      Fixes #24782
      
      Change-Id: I01f5c76d9a07f44e1b04861bfe9f9916a04e65ca
      Reviewed-on: https://go-review.googlesource.com/121316Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      83092a40
    • Michael Fraenkel's avatar
      net: parse IPv6 address with zone using DefaultResolver.Lookup{Host,IPAddr} · d144dd78
      Michael Fraenkel authored
      Allow a zone to be included with the ip address that is parsed when
      using DefaultResolver's LookupHost or LookupIPAddr
      
      Fixes #20790
      Fixes #20767
      
      Change-Id: I4e0baf9ade6a095af10a1b85ca6216788ba680ae
      Reviewed-on: https://go-review.googlesource.com/79935
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d144dd78
    • Richard Musiol's avatar
      syscall/js: add TypedArrayOf · bafe466a
      Richard Musiol authored
      The new function js.TypedArrayOf returns a JavaScript typed array for
      a given slice.
      https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays
      
      This change also changes js.ValueOf to not accept a []byte any more.
      
      Fixes #25532.
      
      Change-Id: I8c7bc98ca4e21c3514d19eee7a1f92388d74ab2a
      Reviewed-on: https://go-review.googlesource.com/121215
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      bafe466a
    • Grégoire Delattre's avatar
      net: make concurrent resolver lookups independent · 63a4acba
      Grégoire Delattre authored
      The current resolver uses a global lookupGroup which merges LookupIPAddr
      calls together for lookups for the same hostname if used concurrently.
      As a result only one of the resolvers is actually used to perform the
      DNS lookup but the result is shared by all the resolvers.
      
      This commit limits the scope of the lookupGroup to the resolver itself
      allowing each resolver to make its own requests without sharing the
      result with other resolvers.
      
      Fixes #22908
      
      Change-Id: Ibba896eebb05e59f18ce4132564ea1f2b4b6c6d9
      Reviewed-on: https://go-review.googlesource.com/80775
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      63a4acba
    • Vlad Krasnov's avatar
      crypto/elliptic: implement P256 for arm64 · 0246915f
      Vlad Krasnov authored
      This patch ports the existing optimized P256 implementation to arm64.
      
      name            old time/op    new time/op    delta
      pkg:crypto/ecdsa goos:linux goarch:arm64
      SignP256           539µs ±13%      43µs ± 2%  -91.95%  (p=0.000 n=20+20)
      SignP384          13.2ms ± 1%    13.2ms ± 1%     ~     (p=0.739 n=10+10)
      VerifyP256        1.57ms ± 0%    0.12ms ± 0%  -92.40%  (p=0.000 n=18+20)
      KeyGeneration      391µs ± 0%      25µs ± 0%  -93.62%  (p=0.000 n=9+9)
      pkg:crypto/elliptic goos:linux goarch:arm64
      BaseMult          1.66ms ± 0%    1.65ms ± 1%     ~     (p=0.079 n=9+10)
      BaseMultP256       389µs ± 0%      22µs ± 1%  -94.28%  (p=0.000 n=19+20)
      ScalarMultP256    1.03ms ± 0%    0.09ms ± 0%  -91.25%  (p=0.000 n=19+20)
      
      name            old alloc/op   new alloc/op   delta
      pkg:crypto/ecdsa goos:linux goarch:arm64
      SignP256          5.47kB ± 0%    3.20kB ± 0%  -41.50%  (p=0.000 n=20+20)
      SignP384          2.32MB ± 0%    2.32MB ± 0%     ~     (p=0.739 n=10+10)
      VerifyP256        7.65kB ± 4%    0.98kB ± 0%  -87.24%  (p=0.000 n=20+20)
      KeyGeneration     1.41kB ± 0%    0.69kB ± 0%  -51.05%  (p=0.000 n=9+10)
      pkg:crypto/elliptic goos:linux goarch:arm64
      BaseMult            224B ± 0%      224B ± 0%     ~     (all equal)
      BaseMultP256      1.12kB ± 0%    0.29kB ± 0%  -74.29%  (p=0.000 n=20+20)
      ScalarMultP256    1.59kB ± 7%    0.26kB ± 0%  -83.91%  (p=0.000 n=20+20)
      
      name            old allocs/op  new allocs/op  delta
      pkg:crypto/ecdsa goos:linux goarch:arm64
      SignP256            67.0 ± 0%      35.0 ± 0%  -47.76%  (p=0.000 n=20+20)
      SignP384           17.5k ± 0%     17.5k ± 0%     ~     (p=0.725 n=10+10)
      VerifyP256          97.2 ± 3%      17.0 ± 0%  -82.52%  (p=0.000 n=20+20)
      KeyGeneration       21.0 ± 0%      13.0 ± 0%  -38.10%  (p=0.000 n=10+10)
      pkg:crypto/elliptic goos:linux goarch:arm64
      BaseMult            5.00 ± 0%      5.00 ± 0%     ~     (all equal)
      BaseMultP256        16.0 ± 0%       6.0 ± 0%  -62.50%  (p=0.000 n=20+20)
      ScalarMultP256      19.9 ± 6%       5.0 ± 0%  -74.87%  (p=0.000 n=20+20)
      
      Fixes #22806
      
      Change-Id: I0f187074f8c3069bf8692d59e2cf95bdc6061fe7
      Reviewed-on: https://go-review.googlesource.com/99755
      Run-TryBot: Vlad Krasnov <vlad@cloudflare.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrendan McMillion <brendan@cloudflare.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      0246915f
    • Brad Fitzpatrick's avatar
      net/http/httptrace: add clarification never added to CL 67430 · 87b7b667
      Brad Fitzpatrick authored
      Updates #19761
      
      Change-Id: Iac3bd4c40002f8e348452b50bff54dee3210d447
      Reviewed-on: https://go-review.googlesource.com/121236Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      87b7b667
    • Ian Lance Taylor's avatar
      mime/quotedprintable: accept bytes >= 0x80 · 228b4416
      Ian Lance Taylor authored
      RFC 2045 doesn't permit non-ASCII bytes, but some systems send them
      anyhow. With this change, we accept them. This does make it harder to
      validate quotedprintable data, but on balance this seems like the best
      approach given the existence of systems that generate invalid data.
      
      Fixes #22597
      
      Change-Id: I9f80f90a60b76ada2b5dea658b8dc8aace56cdbd
      Reviewed-on: https://go-review.googlesource.com/121095Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      228b4416
    • Ian Lance Taylor's avatar
      net: limit concurrent threads to limit on file descriptors · b7498450
      Ian Lance Taylor authored
      At least on Darwin, if getaddrinfo can't open a file descriptor it
      returns EAI_NONAME ("no such host") rather than a meaningful error.
      Limit the number of concurrent getaddrinfo calls to the number of file
      descriptors we can open, to make that meaningless error less likely.
      
      We don't apply the same limit to Go lookups, because for that we will
      return a meaningful "too many open files" error.
      
      Fixes #25694
      
      Change-Id: I601857190aeb64f11e22b4a834c1c6a722a0788d
      Reviewed-on: https://go-review.googlesource.com/121176Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      b7498450
    • Meir Fischer's avatar
      net/http/httptrace: expose request headers for http/1.1 · 7c4c87c0
      Meir Fischer authored
      Some headers, which are set or modified by the http library,
      are not written to the standard http.Request.Header and are
      not included as part of http.Response.Request.Header.
      
      Exposing all headers alleviates this problem.
      
      This is not a complete solution to 19761 since it does not have http/2 support.
      
      Updates #19761
      
      Change-Id: Ie8d4f702f4f671666b120b332378644f094e288b
      Reviewed-on: https://go-review.googlesource.com/67430
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7c4c87c0
    • Cherry Zhang's avatar
      cmd/compile: fold offset into address on Wasm · 1d303a00
      Cherry Zhang authored
      On Wasm, the offset was not folded into LoweredAddr, so it was
      not rematerializeable. This led to the address-taken operation
      in some cases generated too early, before the local variable
      becoming live. The liveness code thinks the variable live when
      the address is taken, then backs it up to live at function
      entry, then complains about it, because nothing other than
      arguments should be live on entry.
      
      This CL folds the offset into the address operation, so it is
      rematerializeable and so generated right before use, after the
      variable actually becomes live.
      
      It might be possible to relax the liveness code not to think a
      variable live when its address being taken, but until the address
      actually being used. But it would be quite complicated. As we're
      late in Go 1.11 freeze, it would be better not to do it. Also,
      I think the address operation is rematerializeable now on all
      architectures, so this is probably less necessary.
      
      This may also be a slight optimization, as the address+offset is
      now rematerializeable, which can be generated on the Wasm stack,
      without using any "registers" which are emulated by local
      variables on Wasm. I don't know how to do benchmarks on Wasm. At
      least, cmd/go binary size shrinks 9K.
      
      Fixes #25966.
      
      Change-Id: I01e5869515d6a3942fccdcb857f924a866876e57
      Reviewed-on: https://go-review.googlesource.com/120599
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRichard Musiol <neelance@gmail.com>
      1d303a00