1. 03 Oct, 2017 1 commit
  2. 02 Oct, 2017 9 commits
  3. 01 Oct, 2017 2 commits
  4. 30 Sep, 2017 4 commits
    • Adam Langley's avatar
      encoding/asn1: respect “explicit” and “tag” when unmarshaling RawValues. · a82ee9c7
      Adam Langley authored
      Previously, any “explicit” and/or “tag” decorations on a RawValue would
      be ignored when unmarshaling. The RawValue would swallow whatever
      element was encountered.
      
      This change causes these decorations to be respected. Thus a field like:
        Foo asn1.RawValue `asn1:"explicit,tag:1,optional"`
      will only match if an explicit tag with value one is encountered.
      Otherwise the RawValue will get the default value and parsing will move
      onto the next element.
      
      Thanks to Martin Kreichgauer for reporting the issue.
      
      Change-Id: If6c4488685b9bd039cb5e352d6d75744f98dbb1f
      Reviewed-on: https://go-review.googlesource.com/34503
      Run-TryBot: Adam Langley <agl@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAdam Langley <agl@golang.org>
      a82ee9c7
    • Russ Cox's avatar
      cmd/go: stop creating nested temp directory trees · ee4fbbc6
      Russ Cox authored
      Now that we have -importcfg, there's no need for the
      temporary directory trees that mirror the import path structure,
      and we can drop a bunch of complex code that was building
      and maintaining that structure.
      
      This should fix "file name too long" errors on systems with low limits.
      (For example #10651 and #17070, although we fixed those by
      adding code to deal with very long file names on Windows instead.)
      
      Change-Id: I11e221c6c1edeb81c3b2f1d89988f5235aa2bbb9
      Reviewed-on: https://go-review.googlesource.com/56280Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      ee4fbbc6
    • Russ Cox's avatar
      cmd/go: hide work subdirectory names in gcc/clang object files · a1fb024a
      Russ Cox authored
      Until now the subdirectories under $WORK have had predictable
      names, so it was OK to strip just $WORK from the file names that
      end up in object files. In the future, those predictable names would
      cause predictable collisions when compiling one package in two
      different ways, so we're moving toward arbitrary, unpredictable
      subdirectory names instead. When we do that, if the names appear
      in the object files we won't get reproducible builds.
      
      Take the subdirectory names out now, to make the later change safe.
      
      Change-Id: I8057d1cc73f6e35c98b7718c9789c161dcbd87c0
      Reviewed-on: https://go-review.googlesource.com/67251
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a1fb024a
    • Russ Cox's avatar
      cmd/go: rename .o files going into final .a · 1409c287
      Russ Cox authored
      CL 64793 removed the collect step, which took all
      the generated .o files and merged them into a single _all.o.
      Now the generated .o files all go directly into the final .a.
      
      The only property of the _all.o approach that was lost
      in CL 64793 was that before we could be sure that the
      one name we used was "ar-compatible", that is, short
      enough not to be truncated.
      
      Now that the generated .o files are being kept directly,
      this CL gives them guaranteed ar-compatible names.
      
      This doesn't matter for nearly all uses today, but for some
      future processing it might help not to lose the .o suffix
      or not to end up with two identical entries with truncated
      names.
      
      I might not have bothered with this except that it's what's
      leftover after syncing my own CL disabling _all.o
      (necessary for reproducible builds on macOS) against
      Ian's CL 64793, which landed first.
      
      Change-Id: Ic86ed2a51432a5a4c58dc523e092a86d341f1997
      Reviewed-on: https://go-review.googlesource.com/67250
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      1409c287
  5. 29 Sep, 2017 7 commits
  6. 28 Sep, 2017 9 commits
  7. 27 Sep, 2017 8 commits
    • Daniel Martí's avatar
      cmd/compile: fix another invalid switch case panic · 39e52379
      Daniel Martí authored
      Very similar fix to the one made in golang.org/cl/65655. This time it's
      for switches on interface values, as we look for duplicates in a
      different manner to keep types in mind.
      
      As before, add a small regression test.
      
      Updates #22001.
      Fixes #22063.
      
      Change-Id: I9a55d08999aeca262ad276b4649b51848a627b02
      Reviewed-on: https://go-review.googlesource.com/66450
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      39e52379
    • Cyrill Schumacher's avatar
      database/sql: TestConversions add forgotten fields wantbytes and wantraw · 70bcd2c5
      Cyrill Schumacher authored
      The fields wantbytes and wantraw in the test struct `conversionTest` has
      been forgotten to include in the TestConversions function.
      
      Change-Id: I6dab69e76de3799a1bbf9fa09a15607e55172114
      Reviewed-on: https://go-review.googlesource.com/66610Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
      Reviewed-by: 's avatarDaniel Theophanes <kardianos@gmail.com>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      70bcd2c5
    • Agniva De Sarker's avatar
      cmd/cgo: simplify a call to strip spaces · ecff9431
      Agniva De Sarker authored
      Combined the Split and Join call with a Replace. This simplifies
      the code as well as makes it fast.
      
      Micro-benchmarks show good improvements -
      
      func BenchmarkJoinSplit(b *testing.B) {
        for n := 0; n < b.N; n++ {
          strings.Join(strings.Split("this string has some spaces", " "), "")
        }
      }
      
      func BenchmarkReplace(b *testing.B) {
        for n := 0; n < b.N; n++ {
          strings.Replace("this string has some spaces", " ", "", -1)
        }
      }
      
      name         old time/op    new time/op    delta
      JoinSplit-4     308ns ± 2%     192ns ± 4%  -37.60%  (p=0.008 n=5+5)
      
      name         old alloc/op   new alloc/op   delta
      JoinSplit-4      144B ± 0%       64B ± 0%  -55.56%  (p=0.008 n=5+5)
      
      name         old allocs/op  new allocs/op  delta
      JoinSplit-4      3.00 ± 0%      2.00 ± 0%  -33.33%  (p=0.008 n=5+5)
      
      Change-Id: I1dc32105ae7a0be5a43ab0bedde992cefbed5d7d
      Reviewed-on: https://go-review.googlesource.com/66590
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      ecff9431
    • Joe Tsai's avatar
      reflect: add URL scheme for godoc hyperlinking · d94078f0
      Joe Tsai authored
      Adding the "https://" scheme allows godoc to properly detect
      the URL and provide a hyperlink for it.
      
      Change-Id: I76dc309368c86975de01bc6e6e9196037b2114d7
      Reviewed-on: https://go-review.googlesource.com/66570Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d94078f0
    • Matthew Dempsky's avatar
      reflect: fix mutability of non-exported embedded fields · 6471ace2
      Matthew Dempsky authored
      The reflect API normally grants only read-only access to non-exported
      fields, but it specially handles non-exported embedded fields so that
      users can still fully access promoted fields and methods. For example,
      if v.Field(i) refers to a non-exported embedded field, it would be
      limited to RO access. But if v.Field(i).Field(j) is an exported field,
      then the resulting Value will have full access.
      
      However, the way this was implemented allowed other operations to be
      interspersed between the Field calls, which could grant inappropriate
      access.
      
      Relatedly, Elem() is safe to use on pointer-embeddings, but it was
      also being allowed on embeddings of interface types. This is
      inappropriate because it could allow accessing methods of the dynamic
      value's complete method set, not just those that were promoted via the
      interface embedding.
      
      Fixes #22031.
      Fixes #22053.
      
      Change-Id: I9db9be88583f1c1d80c1b4705a76f23a4379182f
      Reviewed-on: https://go-review.googlesource.com/66331
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      6471ace2
    • Austin Clements's avatar
      runtime: allow more CPUs on FreeBSD · a714470c
      Austin Clements authored
      Currently the FreeBSD CPU affinity code assumes that the maximum
      GOMAXPROCS is 256, but we just removed that limit.
      
      This commit rewrites the FreeBSD CPU affinity code to raise the CPU
      count limit to 65,536, like the Linux CPU affinity code, and to
      degrade more gracefully if we do somehow go over that.
      
      Change-Id: Ic4ca7f88bd8b9448aae4dbd43ef21a6c1b8fea63
      Reviewed-on: https://go-review.googlesource.com/66291
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      a714470c
    • Austin Clements's avatar
      runtime: clean up loops over allp · e900e275
      Austin Clements authored
      allp now has length gomaxprocs, which means none of allp[i] are nil or
      in state _Pdead. This lets replace several different styles of loops
      over allp with normal range loops.
      
      for i := 0; i < gomaxprocs; i++ { ... } loops can simply range over
      allp. Likewise, range loops over allp[:gomaxprocs] can just range over
      allp.
      
      Loops that check for p == nil || p.state == _Pdead don't need to check
      this any more.
      
      Loops that check for p == nil don't have to check this *if* dead Ps
      don't affect them. I checked that all such loops are, in fact,
      unaffected by dead Ps. One loop was potentially affected, which this
      fixes by zeroing p.gcAssistTime in procresize.
      
      Updates #15131.
      
      Change-Id: Ifa1c2a86ed59892eca0610360a75bb613bc6dcee
      Reviewed-on: https://go-review.googlesource.com/45575
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      e900e275
    • Austin Clements's avatar
      runtime: eliminate GOMAXPROCS limit · ee55000f
      Austin Clements authored
      Now that allp is dynamically allocated, there's no need for a hard cap
      on GOMAXPROCS.
      
      Fixes #15131.
      
      Change-Id: I53eee8e228a711a818f7ebce8d9fd915b3865eed
      Reviewed-on: https://go-review.googlesource.com/45574
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      ee55000f