- 30 Sep, 2015 6 commits
-
-
Robert Griesemer authored
Applied identical change to cmd/gofmt/internal.go. Fixes #11275. Change-Id: Icb4bf0460c94c9e2830dd0d62c69376774cbda30 Reviewed-on: https://go-review.googlesource.com/15154Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
Fixes #11844. Change-Id: I32edd39e79f7c9bdc132c49bd06081f35dac245d Reviewed-on: https://go-review.googlesource.com/15114Reviewed-by: Alan Donovan <adonovan@google.com>
-
Adam Langley authored
The format for a CSR is horribly underspecified and we had a mistake. The code was parsing the attributes from the CSR as a pkix.AttributeTypeAndValueSET, which is only almost correct: it works so long as the requested extensions don't contain the optional “critical” flag. Unfortunately this mistake is exported somewhat in the API and the Attributes field of a CSR actually has the wrong type. I've moved this field to the bottom of the structure and updated the comment to reflect this. The Extensions and other fields of the CSR structure can be saved however and this change does that. Fixes #11897. Change-Id: If8e2f5c21934800b72b041e38691efc3e897ecf1 Reviewed-on: https://go-review.googlesource.com/12717Reviewed-by: Rob Pike <r@golang.org>
-
Adam Langley authored
Platform-specific verification needs the ASN.1 contents of a certificate but that might not be provided if the Certificate was not created by ParseCertificate. In order to avoid a panic on Windows, and to make behaviour consistent across platforms, this change causes verification to fail when the ASN.1 contents of a certificate are not available. Fixes #12184 Change-Id: I4395d74934e675c179eaf4cded1094a756e478bb Reviewed-on: https://go-review.googlesource.com/14053Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Adam Langley authored
As akalin points out in the bug, the comment previously claimed that the probability that the input is prime given that the function returned true is 1 - ¼ⁿ. But that's wrong: the correct statement is that the probability of the function returning false given a composite input is 1 - ¼ⁿ. This is not nearly as helpful, but at least it's truthful. A number of other (correct) expressions are suggested on the bug, but I think that the simplier one is preferable. This change also notes that the function is not suitable for adversarial inputs since it's deterministic. Fixes #12274. Change-Id: I6a0871d103b126ee5a5a922a8c6993055cb7b1ed Reviewed-on: https://go-review.googlesource.com/14052Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Adam Langley authored
This change causes the types of skipped PEM blocks to be recorded when no certificate or private-key data is found in a PEM input. This allows for better error messages to be return in the case of common errors like switching the certifiate and key inputs to X509KeyPair. Fixes #11092 Change-Id: Ifc155a811cdcddd93b5787fe16a84c972011f2f7 Reviewed-on: https://go-review.googlesource.com/14054Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 29 Sep, 2015 9 commits
-
-
Robert Griesemer authored
This is a copy of x/tools/cmd/gotype/gotype.go with the corresponding x/tools/cmd/gotype/doc.go prepended and including a build tag (ignore). This way, go/types can be built unaffected. If we need the gotype command, it is trivially built in the go/types directory with: go build gotype.go . Fixes #12303. Change-Id: I2d792fcb39719cc5cc300f657e4735901cd20faa Reviewed-on: https://go-review.googlesource.com/15152Reviewed-by: Rob Pike <r@golang.org>
-
Robert Griesemer authored
For #12787. Change-Id: I921d01c8d7d97f3453b25e6d2241a43c5d64f53b Reviewed-on: https://go-review.googlesource.com/15150Reviewed-by: Alan Donovan <adonovan@google.com>
-
Russ Cox authored
(Changed modified by bradfitz from original rsc version) Change-Id: I8ea40044c325f333a13d48b59b4795b02c579533 Reviewed-on: https://go-review.googlesource.com/14026Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Håvard Haugen authored
Inlined the last occurrence of stringsCompare into exprcmp. Passes go build -a -toolexec 'toolstash -cmp' std cmd. Change-Id: I8fd99e3fbffc84283cc269368595cba950533066 Reviewed-on: https://go-review.googlesource.com/14872Reviewed-by: Dave Cheney <dave@cheney.net> Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Rob Pike authored
The code to strip GOROOT and GOPATH had a bug: it assumed there were bytes after the GOROOT prefix but there might not be. Fix this and other issues by taking care the prefix is really a file name prefix for the path, not just a string prefix, and handle the case where GOROOT==path. Change-Id: I8066865fd05f938bb6dbf3bb8ab1fc58e5cf6bb5 Reviewed-on: https://go-review.googlesource.com/15112 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Robert Griesemer authored
Good enough for now. Fixes #11241. Change-Id: Ieb50809f104d20bcbe14daecac503f72486bec92 Reviewed-on: https://go-review.googlesource.com/15111Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
- more uniform naming - test sign more deliberately - remove superfluous test (JSON encoder always uses the JSON marshaler if present) Change-Id: I37b1e367c01fc8bae1e06adbdb72dd366c08d5ce Reviewed-on: https://go-review.googlesource.com/15110Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
Fixes #12256. Change-Id: Ie4a3337996da5c060b27530b076048ffead85f3b Reviewed-on: https://go-review.googlesource.com/15040Reviewed-by: Alan Donovan <adonovan@google.com>
-
Andrew Gerrand authored
Change-Id: I004a43842430201296363a9745480bee94920041 Reviewed-on: https://go-review.googlesource.com/15084Reviewed-by: Andrew Gerrand <adg@golang.org>
-
- 28 Sep, 2015 7 commits
-
-
Andrew Gerrand authored
Change-Id: Ide82ac98dc7cb1035ceb9d461ed95af899f8f983 Reviewed-on: https://go-review.googlesource.com/15081Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Robert Griesemer authored
Change-Id: I63da54832548c325e47dc54aaa5b5112e1f3b3ba Reviewed-on: https://go-review.googlesource.com/15048Reviewed-by: Rob Pike <r@golang.org>
-
Robert Griesemer authored
- moved existing package documentation from nat.go to doc.go - expanded on it For #11241. Change-Id: Ie75a2b0178a8904a4154307a1f5080d7efc5489a Reviewed-on: https://go-review.googlesource.com/15042Reviewed-by: Alan Donovan <adonovan@google.com>
-
Rob Pike authored
Main change is that the comment for an item no longer has a blank line before it, so it looks bound to the item it's about. Motivating example: go doc.io.read changes from < func (l *LimitedReader) Read(p []byte) (n int, err error) func (r *PipeReader) Read(data []byte) (n int, err error) Read implements the standard Read interface: it reads data from the pipe, blocking until a writer arrives or the write end is closed. If the write end is closed with an error, that error is returned as err; otherwise err is EOF. func (s *SectionReader) Read(p []byte) (n int, err error) > to < func (l *LimitedReader) Read(p []byte) (n int, err error) func (r *PipeReader) Read(data []byte) (n int, err error) Read implements the standard Read interface: it reads data from the pipe, blocking until a writer arrives or the write end is closed. If the write end is closed with an error, that error is returned as err; otherwise err is EOF. func (s *SectionReader) Read(p []byte) (n int, err error) > Now the comment about PipeReader.Read doesn't look like it's about SectionReader. Based on a suggestion by dsnet@, a slight tweak from a CL he suggested and abandoned. Fixes #12756, Change-Id: Iaf60ee9ae7f644c83c32d5e130acab0312b0c926 Reviewed-on: https://go-review.googlesource.com/14999Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Andrew Gerrand authored
This change adds a new "block" keyword that permits the definition of templates inline inside existing templates, and loosens the restriction on template redefinition. Templates may now be redefined, but in the html/template package they may only be redefined before the template is executed (and therefore escaped). The intention is that such inline templates can be redefined by subsequent template definitions, permitting a kind of template "inheritance" or "overlay". (See the example for details.) Fixes #3812 Change-Id: I733cb5332c1c201c235f759cc64333462e70dc27 Reviewed-on: https://go-review.googlesource.com/14005Reviewed-by: Rob Pike <r@golang.org>
-
Ian Lance Taylor authored
When exporting a function using gccgo, we generate two functions: a Go function with a leading Cgoexp_ prefix, and a C function that calls the Go function. The Go function has a name that can not be represented in C, so the C code needs a declaration with an __asm__ qualifier giving the name of the Go function. Before this CL we put that declaration in the exported header file. Because code would sometimes #include "_cgo_export.h", we added a macro definition for the C function giving it the name of the declaration. We then added a macro undefine in the actual C code, so that we could declare the C function we wanted. This rounadabout process worked OK until we started exporting the header file for use with -buildmode=c-archive and c-shared. Doing that caused the code to see the define and thus call the Go function rather than the C function. That often works fine, but the C function calls _cgo_wait_runtime_init_done before calling the Go function, and that sometimes matters. This didn't show up in tests because we don't test using gccgo. That is something we should fix, but not now. Fix that by simplifying the code to declare the C function in the header file as one would expect, and move the __asm__ declaration to the C code. Change-Id: I33547e028152ff98e332630994b4f33285feec32 Reviewed-on: https://go-review.googlesource.com/15043Reviewed-by: Minux Ma <minux@golang.org>
-
Joel Sing authored
As detailed in #11910, the current implementation attempts to execute an area of memory with unknown content. If the memory is executable, the result is unpredictable - instead, make the test deterministic by attempting to execute an instruction that is known to trigger a trap on the given architecture. The new implementation is written by iant@ and provided via #11910. Update issue #11910 Change-Id: Ia698c36e0dd98a9d9d16a701f60f6748c6faf896 Reviewed-on: https://go-review.googlesource.com/15058 Run-TryBot: Joel Sing <jsing@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 27 Sep, 2015 2 commits
-
-
Didier Spezia authored
As stated in FastCGI specifications: FastCGI transmits a name-value pair as the length of the name, followed by the length of the value, followed by the name, followed by the value. The current implementation trusts the name and value length provided in the record, leading to a panic if the record is malformed. Added an explicit check on the lengths. Test case and fix suggested by diogin@gmail.com (Jingcheng Zhang) Fixes #11824 Change-Id: I883a1982ea46465e1fb02e0e02b6a4df9e529ae4 Reviewed-on: https://go-review.googlesource.com/15015Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Joel Sing authored
openbsd/arm does not support external linking - skip the note reading test that uses linkmode external on this platform. While here, cleanup the code and consistently use t.Skipf for all platforms that cannot run this test. Change-Id: I64f0d9e038bc4c993c3d843fc069a0b723a924d6 Reviewed-on: https://go-review.googlesource.com/15054Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 25 Sep, 2015 8 commits
-
-
Robert Griesemer authored
Change-Id: I1180aa3d30fb8563c8e6ecefeb3296af0a88f5a6 Reviewed-on: https://go-review.googlesource.com/14998Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
Like int/rat/float conversions, move this functionality into separate implementation and test files. No implementation changes besides the move. Change-Id: If19c45f5a72a57b95cbce2329724693ae5a4807d Reviewed-on: https://go-review.googlesource.com/14997Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
- renamed (nat) itoa to utoa (since that's what it is) - added (nat) itoa that takes a sign parameter; this helps removing a few string copies - used buffers instead of string+ in Rat conversions Change-Id: I6b37a6b39557ae311cafdfe5c4a26e9246bde1a9 Reviewed-on: https://go-review.googlesource.com/14995Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
This makes the Int conversion routines match the respective strconv and big.Float conversion routines. Change-Id: I5cfcda1632ee52fe87c5bb75892bdda76cc3af15 Reviewed-on: https://go-review.googlesource.com/14994Reviewed-by: Alan Donovan <adonovan@google.com>
-
Mikio Hara authored
When link-layer information is wrapped with sockaddr_dl, we need to follow the len field of sockaddr_dl. When link-layer information is naked, we need to use the length of whole link-layer information. Fixes #12641. Change-Id: I4d377f64cbab1760b993fc55c719288616042bbb Reviewed-on: https://go-review.googlesource.com/14939Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Rob Pike authored
Change-Id: I2714faa6e8aa7b81a05f0e015b045a57407d808d Reviewed-on: https://go-review.googlesource.com/14996Reviewed-by: Rob Pike <r@golang.org>
-
Rob Pike authored
The Scan function's interface to the split function was not sufficient to handle an empty final token in a pure function; state was required. This was ugly. We introduce a special error value that a split function can return that signals that this token is OK, but is the last one and scanning should stop immediately _after_ this token. The same effect could be achieved using the same trick (a special error value) and checking for that error after Scan finishes, but it's a little clumsy. Providing a published sentinel value in bufio is cleaner and means everyone can use the same trick. The result is an error-free scan. Rewrite the test (that was only barely working) to use the value and be more robust. Also write a new example showing how to do it. Fixes #11836 Change-Id: Iaae77d0f95b4a2efa0175ced94d93c66353079e8 Reviewed-on: https://go-review.googlesource.com/14924Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Shawn Walker-Salas authored
Some linker flags should only be applied when performing the final linking step for a shared library or executable, etc. In other contexts, they're either invalid, or meaningless to apply (so should not be specified). When an external linker is used (either directly by Go or by the compiler driver used by cgo), -rpath and -rpath-link should only be specified in the final linking step. On platforms such as Solaris, ld(1) will reject its use in any other scenario (such as when linking relocatable objects). This change is necessary because Go does not currently offer a way to specify LDFLAGS based on when they should be applied. Fixes #12115 Change-Id: If35a18d8eee8ec7ddcca2d4ccd41ab6ffcf93b41 Reviewed-on: https://go-review.googlesource.com/14674Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 24 Sep, 2015 8 commits
-
-
Robert Griesemer authored
Eliminated unnecessary string conversions throughout and removed (internal) capability for arbitrary character sets in conversion routines (functionality was not exported and not used internally). benchmark old ns/op new ns/op delta BenchmarkDecimalConversion-8 198283 187085 -5.65% BenchmarkStringPiParallel-8 46116 47822 +3.70% BenchmarkString10Base2-8 216 166 -23.15% BenchmarkString100Base2-8 886 762 -14.00% BenchmarkString1000Base2-8 7296 6625 -9.20% BenchmarkString10000Base2-8 72371 65563 -9.41% BenchmarkString100000Base2-8 725849 672766 -7.31% BenchmarkString10Base8-8 160 114 -28.75% BenchmarkString100Base8-8 398 309 -22.36% BenchmarkString1000Base8-8 2650 2244 -15.32% BenchmarkString10000Base8-8 24974 21745 -12.93% BenchmarkString100000Base8-8 245457 217489 -11.39% BenchmarkString10Base10-8 337 288 -14.54% BenchmarkString100Base10-8 1298 1046 -19.41% BenchmarkString1000Base10-8 6200 5752 -7.23% BenchmarkString10000Base10-8 24942 22589 -9.43% BenchmarkString100000Base10-8 8012921 7947152 -0.82% BenchmarkString10Base16-8 156 107 -31.41% BenchmarkString100Base16-8 344 255 -25.87% BenchmarkString1000Base16-8 2067 1705 -17.51% BenchmarkString10000Base16-8 19026 16112 -15.32% BenchmarkString100000Base16-8 184038 163457 -11.18% Change-Id: I68bd807529bd9b985f4b6ac2a87764bcc1a7d2f7 Reviewed-on: https://go-review.googlesource.com/14926Reviewed-by: Alan Donovan <adonovan@google.com>
-
Rob Pike authored
The test case is go doc rand.Float64 The first package it finds is crypto/rand, which does not have a Float64. Before this change, cmd/doc would stop there even though math/rand has the symbol. After this change, we get: % go doc rand.Float64 package rand // import "math/rand" func Float64() float64 Float64 returns, as a float64, a pseudo-random number in [0.0,1.0) from the default Source. % Another nice consequence is that if a symbol is not found, we might get a longer list of packages that were examined: % go doc rand.Int64 doc: no symbol Int64 in packages crypto/rand, math/rand exit status 1 % This change introduces a coroutine to scan the file system so that if the symbol is not found, the coroutine can deliver another path to try. (This is darned close to the original motivation for coroutines.) Paths are delivered on an unbuffered channel so the scanner does not proceed until candidate paths are needed. The scanner is attached to a new type, called Dirs, that caches the results so if we need to scan a second time, we don't walk the file system again. This is significantly more efficient than the existing code, which could scan the tree multiple times looking for a package with the symbol. Change-Id: I2789505b9992cf04c19376c51ae09af3bc305f7f Reviewed-on: https://go-review.googlesource.com/14921Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Robert Griesemer authored
Also: removed unnecessary BUG comment (was fixed). Change-Id: I8f11fbcb4e30a19ec5a25df742b3e25e2ee7f846 Reviewed-on: https://go-review.googlesource.com/14923Reviewed-by: Alan Donovan <adonovan@google.com>
-
Marvin Stenger authored
Passes go build -toolexec 'toolstash -cmp' -a std. Change-Id: Iea8c7bba2401f61ddf2caffc4bece2c293d10f74 Reviewed-on: https://go-review.googlesource.com/14951Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Marvin Stenger authored
Only one use of stringsCompare is left. Cannot simply be replaced by strings.Compare for bootstrapping reasons I guess. Moving the function away from util.go to the actual destination data.go also would not help much. So I left this one unchanged for readability and convenience. Change-Id: I60d22fec0be8f8c47c80586436f9a550af59194e Reviewed-on: https://go-review.googlesource.com/14953Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Marvin Stenger authored
Moves the functions: isSpace(int) bool isAlpha(int) bool isDigit(int) bool isAlnum(int) bool plan9quote(string) string Passes go build -toolexec 'toolstash -cmp' -a std. Change-Id: I6f946981abb6f29b047ad90d5c117847e826789f Reviewed-on: https://go-review.googlesource.com/14952 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Marvin Stenger authored
Passes go build -toolexec 'toolstash -cmp' -a std. Change-Id: I895350987661c1855803d1594dbab16068f8d1bc Reviewed-on: https://go-review.googlesource.com/14873Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Francisco Claude authored
When parsing the multipart data, if the delimiter appears but doesn't finish with -- or \n or \r\n, it assumes the data can be consumed. This is incorrect when the peeking buffer finishes with --delimiter- Fixes #12662 Change-Id: I329556a9a206407c0958289bf7a9009229120bb9 Reviewed-on: https://go-review.googlesource.com/14652 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-