1. 25 Apr, 2019 7 commits
    • Russ Cox's avatar
      cmd/go: add support for GOPROXY list · f30c5645
      Russ Cox authored
      Following discussion on golang.org/issue/26334, this CL changes
      the GOPROXY environment setting to be a list of proxies, tried in
      sequence. The first successful or non-404/410 error is taken as
      authoritative. Otherwise the next proxy is tried, and so on.
      
      As in earlier releases, GOPROXY=direct means "connect directly",
      but now it can appear in a longer list as well.
      
      This will let companies run a proxy holding only their private modules
      and let users set GOPROXY=thatproxy,publicproxy or GOPROXY=thatproxy,direct
      to fall back to an alternate mechanism for fetching public modules.
      
      Fixes #26334.
      
      Change-Id: I642f0ae655ec307d9cdcad0830c0baac8670eb9c
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173441
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      f30c5645
    • Russ Cox's avatar
      cmd/go/internal/web: minor api cleanup · 5fa14a31
      Russ Cox authored
      - rename PasswordRedacted to Redacted
      - move URL into Response in redacted form, remove from Get result list
      - add Response.Err to construct non-200 errors
        (otherwise GetBytes is not just a wrapper)
      - make 404/410 errors satisfy Is(err, os.ErrNotExist)
      
      Change-Id: Id15899c1e3dfd30cffb1a75ba79a9a1999913258
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173717
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
      5fa14a31
    • David du Colombier's avatar
      net: fix lookupHost to return DNSError on Plan 9 · be857a63
      David du Colombier authored
      CL 168597 added IsNotFound field to DNSError.
      However, this change broke TestLookupNonLDH on Plan 9
      because LookupHost is expected to return a DNSError,
      while on Plan 9, it returned an error string.
      
      This change fixes the implementation of lookupHost on
      Plan 9 to return a DNSError instead of an error string.
      
      Fixes #31672.
      
      Change-Id: Ia805c8965af63ddee7ccfdebb9462a5502b0269d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173857
      Run-TryBot: David du Colombier <0intro@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      be857a63
    • Baokun Lee's avatar
      cmd/go/internal/modconv: support convert replacements in Gopkg.lock · 70ac1c2f
      Baokun Lee authored
      Fixes #24087.
      Updates #26711.
      
      Change-Id: I7fe6b21fd391253a19cb1d35709a061872ea7b6e
      Reviewed-on: https://go-review.googlesource.com/c/go/+/126915
      Run-TryBot: Baokun Lee <nototon@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      70ac1c2f
    • Brian Kessler's avatar
      cmd/compile: add signed divisibility by power of 2 rules · 44343c77
      Brian Kessler authored
      For powers of two (c=1<<k), the divisibility check x%c == 0 can be made
      just by checking the trailing zeroes via a mask x&(c-1) == 0 even for signed
      integers. This avoids division fix-ups when just divisibility check is needed.
      
      To apply this rule, we match on the fixed-up version of the division. This is
      neccessary because the mod and division rewrite rules are already applied
      during the initial opt pass.
      
      The speed up on amd64 due to elimination of unneccessary fix-up code is ~55%:
      
      name                     old time/op  new time/op  delta
      DivconstI64-4            2.08ns ± 0%  2.09ns ± 1%     ~     (p=0.730 n=5+5)
      DivisiblePow2constI64-4  1.78ns ± 1%  0.81ns ± 1%  -54.66%  (p=0.008 n=5+5)
      DivconstU64-4            2.08ns ± 0%  2.08ns ± 0%     ~     (p=0.683 n=5+5)
      DivconstI32-4            1.53ns ± 0%  1.53ns ± 1%     ~     (p=0.968 n=4+5)
      DivisiblePow2constI32-4  1.79ns ± 1%  0.81ns ± 1%  -54.97%  (p=0.008 n=5+5)
      DivconstU32-4            1.78ns ± 1%  1.80ns ± 2%     ~     (p=0.206 n=5+5)
      DivconstI16-4            1.54ns ± 2%  1.54ns ± 0%     ~     (p=0.238 n=5+4)
      DivisiblePow2constI16-4  1.78ns ± 0%  0.81ns ± 1%  -54.72%  (p=0.000 n=4+5)
      DivconstU16-4            1.00ns ± 5%  1.01ns ± 1%     ~     (p=0.119 n=5+5)
      DivconstI8-4             1.54ns ± 0%  1.54ns ± 2%     ~     (p=0.571 n=4+5)
      DivisiblePow2constI8-4   1.78ns ± 0%  0.82ns ± 8%  -53.71%  (p=0.008 n=5+5)
      DivconstU8-4             0.93ns ± 1%  0.93ns ± 1%     ~     (p=0.643 n=5+5)
      
      A follow-up CL will address the general case of x%c == 0 for signed integers.
      
      Updates #15806
      
      Change-Id: Iabadbbe369b6e0998c8ce85d038ebc236142e42a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173557
      Run-TryBot: Brian Kessler <brian.m.kessler@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      44343c77
    • Josh Bleecher Snyder's avatar
      cmd/compile: don't initialize blank struct fields · 2693b424
      Josh Bleecher Snyder authored
      We already skipped blank field initialization in non-global contexts.
      This change makes the global context treatment match.
      
      Fixes #31546
      
      Change-Id: I40acce49b0a9deb351ae0da098f4c114e425ec63
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173723
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2693b424
    • Josh Bleecher Snyder's avatar
      unicode/utf8: remove some bounds checks from DecodeRune · 7596ad0b
      Josh Bleecher Snyder authored
      The compiler couldn't quite see that reading p[2] and p[3] was safe.
      This change provides a few hints to help it.
      First, make sz an int throughout, rather than just when checking the input length.
      Second, use <= instead of == in later comparisons.
      
      name                  old time/op  new time/op  delta
      DecodeASCIIRune-8     2.62ns ± 3%  2.60ns ± 5%     ~     (p=0.126 n=18+19)
      DecodeJapaneseRune-8  4.46ns ±10%  4.01ns ± 5%  -10.00%  (p=0.000 n=19+20)
      
      Change-Id: I2f78a17e38156fbf8b0f5dd6c07c20d6a47e9209
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173662
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      7596ad0b
  2. 24 Apr, 2019 16 commits
  3. 23 Apr, 2019 17 commits