- 01 Apr, 2019 1 commit
-
-
Jay Conrod authored
LoadPackage was used to load a *load.Package for a command line argument, after pattern expansion. It provided two special cases on top of LoadImport. First, it ensured that "cmd/" packages in GOROOT were installed in "$GOROOT/bin" or "$GOROOT/pkg/tool". Second, it translated absolute paths to packages in GOROOT and GOPATH into regular import paths. With this change, LoadImport now ensures "cmd/" packages have the right Target (without the need for a special case) and search.ImportPaths translates absolute paths. LoadPackage no longer handles these special cases and has been renamed to LoadImportWithFlags, since it's still useful for loading implicit dependencies. Updates #29758 Change-Id: I9d54036f90c3ccd9b3a0fe0eaddaa7749593cc91 Reviewed-on: https://go-review.googlesource.com/c/go/+/167748 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
- 31 Mar, 2019 4 commits
-
-
Segev Finer authored
They were previously indented at the same level as the normal text when printing a single symbol or the description of a field. Running "go doc text/template Must": Before: func Must(t *Template, err error) *Template Must is a helper that wraps a call to a function returning (*Template, error) and panics if the error is non-nil. It is intended for use in variable initializations such as var t = template.Must(template.New("name").Parse("text")) After: func Must(t *Template, err error) *Template Must is a helper that wraps a call to a function returning (*Template, error) and panics if the error is non-nil. It is intended for use in variable initializations such as var t = template.Must(template.New("name").Parse("text")) Running "go doc http Request.Header": Before: type Request struct { // Header contains the request header fields either received // by the server or to be sent by the client. // // If a server received a request with header lines, // // Host: example.com // accept-encoding: gzip, deflate // Accept-Language: en-us // fOO: Bar // foo: two // // then // // Header = map[string][]string{ // "Accept-Encoding": {"gzip, deflate"}, // "Accept-Language": {"en-us"}, // "Foo": {"Bar", "two"}, // } ... After: type Request struct { // Header contains the request header fields either received by the server or // to be sent by the client. // // If a server received a request with header lines, // // Host: example.com // accept-encoding: gzip, deflate // Accept-Language: en-us // fOO: Bar // foo: two // // then // // Header = map[string][]string{ // "Accept-Encoding": {"gzip, deflate"}, // "Accept-Language": {"en-us"}, // "Foo": {"Bar", "two"}, // } ... Fixes #29708 Change-Id: Ibe1a6a7a76d6b19c5737ba6e8210e3ad0b88ce16 GitHub-Last-Rev: 439c0fe70a01490cbd9c3613eba3fe45a3ffd9be GitHub-Pull-Request: golang/go#31120 Reviewed-on: https://go-review.googlesource.com/c/go/+/169957 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
zdjones authored
This is a follow-up CL to https://golang.org/cl/170118, updating a comment made incorrect by that CL. Change-Id: I5a29cfae331fbbbb36c96d96f9e4949393a5942d Reviewed-on: https://go-review.googlesource.com/c/go/+/170123Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Michael Munday authored
Currently the shift amount is only masked on x86. Change it so it is masked on all architectures. In the worst case we generate a couple of extra instructions to perform the masking and in the best case we can elide overflow checks. This particular shift could also be replaced with a rotate instruction during optimization which would remove both the masking instructions and overflow checks on all architectures. Fixes #31165. Change-Id: I16b7a8800b4ba8813dc83735dfc59564e661d3b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/170122 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-
Daniel Martí authored
The first biggest offender was crypto/des.init at ~1%. It's cryptographically broken and the init function is relatively expensive, which is unfortunate as both crypto/tls and crypto/x509 (and by extension, cmd/go) import it. Hide the work behind sync.Once. The second biggest offender was flag.sortFlags at just under 1%, used by the Visit flagset methods. It allocated two slices, which made a difference as cmd/go iterates over multiple flagsets during init. Use a single slice with a direct sort.Interface implementation. Another big offender is initializing global maps. Reducing this work in cmd/go/internal/imports and net/textproto gives us close to another whole 1% in saved work. The former can use map literals, and the latter can hide the work behind sync.Once. Finally, compress/flate used newHuffmanBitWriter as part of init, which allocates many objects and slices. Yet it only used one of the slice fields. Allocating just that slice saves a surprising ~0.3%, since we generated a lot of unnecessary garbage. All in all, these little pieces amount to just over 3% saved CPU time. name old time/op new time/op delta ExecGoEnv-8 3.61ms ± 1% 3.50ms ± 0% -3.02% (p=0.000 n=10+10) Updates #26775. Updates #29382. Change-Id: I915416e88a874c63235ba512617c8aef35c0ca8b Reviewed-on: https://go-review.googlesource.com/c/go/+/166459 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 30 Mar, 2019 3 commits
-
-
zdjones authored
When branching at a bounds check for indexing or slicing ops, prove currently only learns from the upper bound. On the positive branch, we currently learn i < len(a) (or i <= len(a)) in both the signed and unsigned domains. This CL makes prove also learn from the lower bound. Specifically, on the positive branch from index or slicing ops, prove will now ALSO learn i >= 0 in the signed domain (this fact is of no value in the unsigned domain). The substantive change itself is only an additional call to addRestrictions, though I've also inverted the nested switch statements around that call for the sake of clarity. This CL removes 92 bounds checks from std and cmd. It passes all tests and shows no deltas on compilecmp. Fixes #28885 Change-Id: I13eccc36e640eb599fa6dc5aa3be3c7d7abd2d9e Reviewed-on: https://go-review.googlesource.com/c/go/+/170121 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Giovanni Bajo <rasky@develer.com>
-
Cherry Zhang authored
This fixes cgo test issue29563 on Darwin. Updates #29563. Change-Id: If480078461247cd7c95931ae3ad4ca89736dd550 Reviewed-on: https://go-review.googlesource.com/c/go/+/170015 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
In CL 169960 I didn't realize that we also have race detector support for arm64. Change-Id: If77bfb0f700a04c04416dad61ef11e27b1c98e07 Reviewed-on: https://go-review.googlesource.com/c/go/+/170105 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
- 29 Mar, 2019 12 commits
-
-
zdjones authored
Prove requires access to a zero-valued constant in multiple heavily-used code paths. Currently, prove is checking for the existence of the constant on every iteration of these paths, and creating it if not found. This CL preempts all of these checks by finding or creating the zero constant Value, just once, when the factsTable is initialised on entry to prove(). The Method used to initialise the zero constant, func.ConstInt64(), finds an existing constant if present, or creates one in the entry block otherwise. Fixes #31141 Change-Id: Ic9a2fd9d79b67025e24d4483f6e87cf8213ead24 Reviewed-on: https://go-review.googlesource.com/c/go/+/170118Reviewed-by: Giovanni Bajo <rasky@develer.com> Run-TryBot: Giovanni Bajo <rasky@develer.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Jay Conrod authored
If no module in the build list provides an imported package, we try to upgrade to the "@latest" version. If there is a requirement on a version of the module which is newer than the "@latest" version (e.g., a prerelease or pseudoversion), we cannot upgrade further. We previously reported "looping trying to add package" when we saw the package in "@latest" but it was removed later. The meaning of this is unclear for users, so with this change, we explain the package was removed. Fixes #30394 Change-Id: I1b7fec2c37e762fb600e66ee8a4df4aeaf13e67a Reviewed-on: https://go-review.googlesource.com/c/go/+/169720 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
David Chase authored
Would suggest extending capabilities (32-bit, unsigned, etc) in separate CLs because prove bugs are so mystifying. This implements the suggestion in this comment https://go-review.googlesource.com/c/go/+/104041/10/src/cmd/compile/internal/ssa/loopbce.go#164 for inferring properly bounded iteration for loops of the form for i := K0; i < KNN-(K-1); i += K for i := K0; i <= KNN-K; i += K Where KNN is "known non negative" (i.e., len or cap) and K is also not negative. Because i <= KNN-K, i+K <= KNN and no overflow occurs. Also handles decreasing case (K1 > 0) for i := KNN; i >= K0; i -= K1 which works when MININT+K1 < K0 (i.e. MININT < K0-K1, no overflow) Signed only, also only 64 bit for now. Change-Id: I5da6015aba2f781ec76c4ad59c9c48d952325fdc Reviewed-on: https://go-review.googlesource.com/c/go/+/136375 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro>
-
Joel Sing authored
Permit weak symbols to be duplicates - most external linkers allow this and there are various situations where they can occur (including retpoline and retguard). Fixes #29563 Change-Id: I355493c847fbc8f670a85a643db65a4cf8f9883d Reviewed-on: https://go-review.googlesource.com/c/go/+/169658 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Munday authored
This CL adds the 'insert program mask' (IPM) instruction to s390x. IPM stores the current program mask (which contains the condition code) into a general purpose register. This instruction will be useful when implementing intrinsics for the arithmetic functions in the math/bits package. We can also potentially use it to convert some condition codes into bool values. The condition code can be saved and restored using an instruction sequence such as: IPM R4 // save condition code to R4 ... TMLH R4, $0x3000 // restore condition code from R4 We can also use IPM to save the carry bit to a register using an instruction sequence such as: IPM R4 // save condition code to R4 RISBLGZ $31, $31, $3, R4, R4 // isolate carry bit in R4 Change-Id: I169d450b6ea1a7ff8c0286115ddc42618da8a2f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/165997 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Elias Naur authored
Android assumes pthread tls keys correspond to some offset from the TLS base. This is about to change in a future version of Android. Fortunately, Android Q leaves a slot open for use to use, TLS_SLOT_APP. Fixes #29674 Change-Id: Id6ba19afacdfed9b262453714715435e2544185f Reviewed-on: https://go-review.googlesource.com/c/go/+/170117 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Elias Naur authored
We're going to need a different TLS offset for Android Q, so the static offsets used for 386 and amd64 are no longer viable on Android. Introduce runtime·tls_g and use that for indexing into TLS storage. As an added benefit, we can then merge the TLS setup code for all android GOARCHs. While we're at it, remove a bunch of android special cases no longer needed. Updates #29674 Updates #29249 (perhaps fixes it) Change-Id: I77c7385aec7de8f1f6a4da7c9c79999157e39572 Reviewed-on: https://go-review.googlesource.com/c/go/+/169817 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Jordan Liggitt authored
A regression was introduced in CL 137335 (5440bfc2) that caused FlushInterval to not be honored until the first Write() call was encountered. This change starts the flush timer as part of setting up the maxLatencyWriter. Fixes #31125 Fixes #31126 Change-Id: I75325bd926652922219bd1457b2b00ac6d0d41b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/170066Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
Both g and p had a racectx field, but they held different kinds of values. The g field held ThreadState values while the p field held Processor values (to use the names used in the C++ code in the compiler_rt support library). Rename the p field to raceprocctx to reduce potential confusion. Change-Id: Iefba0e259d240171e973054c452c3c15bf3f8f8f Reviewed-on: https://go-review.googlesource.com/c/go/+/169960Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ben Hoyt authored
When I was working on the fix for #31038 (make TrimSpace return nil on all-space input) I noticed that there were no tests for TrimLeftFunc and TrimRightFunc, including the funky nil behavior. So add some! I've just reused the existing TrimFunc test cases for TrimLeftFunc and TrimRightFunc, as well as adding new tests for the empty string and all-trimmed cases (which test the nil-returning behavior of TrimFunc and TrimLeftFunc). Change-Id: Ib580d4364e9b3c91350305f9d9873080d7862904 Reviewed-on: https://go-review.googlesource.com/c/go/+/170061 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
zdjones authored
Prove currently fails to remove bounds checks of the form: if i >= 0 { // hint that i is non-negative for i < len(data) { // i becomes Phi in the loop SSA _ = data[i] // data[Phi]; bounds check!! i++ } } addIndVarRestrictions fails to identify that the loop induction variable, (Phi), is non-negative. As a result, the restrictions, i <= Phi < len(data), are only added for the signed domain. When testing the bounds check, addBranchRestrictions is similarly unable to infer that Phi is non-negative. As a result, the restriction, Phi >= len(data), is only added/tested for the unsigned domain. This CL changes the isNonNegative method to utilise the factTable's partially ordered set (poset). It also adds field factTable.zero to allow isNonNegative to query the poset using the zero(0) constant found or created early in prove. Fixes #28956 Change-Id: I792f886c652eeaa339b0d57d5faefbf5922fe44f Reviewed-on: https://go-review.googlesource.com/c/go/+/161437 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Giovanni Bajo <rasky@develer.com>
-
Agniva De Sarker authored
Get rid of an extra register R5 which just recalculated the value of R4. Reuse R4 instead. We also remove the casting of c to an unsigned char because the initial load of R0 is done with I32Load8U anyways. Also indent the code to make it more readable. name old time/op new time/op delta IndexRune 597ns ± 3% 580ns ± 3% -2.93% (p=0.002 n=10+10) IndexRuneLongString 634ns ± 4% 654ns ± 3% +3.07% (p=0.004 n=10+10) IndexRuneFastPath 57.6ns ± 3% 56.9ns ± 4% ~ (p=0.210 n=10+10) Index 104ns ± 3% 104ns ± 4% ~ (p=0.639 n=10+10) LastIndex 87.1ns ± 5% 85.7ns ± 3% ~ (p=0.171 n=10+10) IndexByte 34.4ns ± 4% 32.9ns ± 5% -4.28% (p=0.002 n=10+10) IndexHard1 21.6ms ± 1% 21.8ms ± 3% ~ (p=0.460 n=8+10) IndexHard2 21.6ms ± 2% 21.9ms ± 5% ~ (p=0.133 n=9+10) IndexHard3 21.8ms ± 3% 21.7ms ± 1% ~ (p=0.579 n=10+10) IndexHard4 21.6ms ± 1% 21.9ms ± 4% ~ (p=0.360 n=8+10) LastIndexHard1 25.1ms ± 2% 25.4ms ± 5% ~ (p=0.853 n=10+10) LastIndexHard2 25.3ms ± 6% 25.2ms ± 5% ~ (p=0.796 n=10+10) LastIndexHard3 25.3ms ± 4% 25.2ms ± 3% ~ (p=0.739 n=10+10) IndexTorture 130µs ± 3% 133µs ± 5% ~ (p=0.218 n=10+10) IndexAnyASCII/1:1 98.4ns ± 5% 96.6ns ± 5% ~ (p=0.054 n=10+10) IndexAnyASCII/1:2 109ns ± 4% 110ns ± 3% ~ (p=0.232 n=10+10) IndexAnyASCII/1:4 135ns ± 4% 134ns ± 3% ~ (p=0.671 n=10+10) IndexAnyASCII/1:8 184ns ± 4% 184ns ± 3% ~ (p=0.749 n=10+10) IndexAnyASCII/1:16 289ns ± 3% 281ns ± 3% -2.73% (p=0.001 n=9+10) IndexAnyASCII/16:1 322ns ± 3% 307ns ± 3% -4.71% (p=0.000 n=10+10) IndexAnyASCII/16:2 329ns ± 3% 320ns ± 3% -2.89% (p=0.008 n=10+10) IndexAnyASCII/16:4 353ns ± 3% 339ns ± 3% -3.91% (p=0.001 n=10+10) IndexAnyASCII/16:8 390ns ± 3% 374ns ± 3% -4.06% (p=0.000 n=10+10) IndexAnyASCII/16:16 471ns ± 4% 452ns ± 2% -4.22% (p=0.000 n=10+10) IndexAnyASCII/256:1 2.94µs ± 4% 2.91µs ± 2% ~ (p=0.424 n=10+10) IndexAnyASCII/256:2 2.92µs ± 3% 2.90µs ± 2% ~ (p=0.388 n=9+10) IndexAnyASCII/256:4 2.93µs ± 1% 2.90µs ± 1% -0.98% (p=0.036 n=8+9) IndexAnyASCII/256:8 3.03µs ± 5% 2.97µs ± 3% ~ (p=0.085 n=10+10) IndexAnyASCII/256:16 3.07µs ± 4% 3.01µs ± 1% -2.03% (p=0.003 n=10+9) IndexAnyASCII/4096:1 45.8µs ± 3% 45.9µs ± 2% ~ (p=0.905 n=10+9) IndexAnyASCII/4096:2 46.7µs ± 3% 46.2µs ± 3% ~ (p=0.190 n=10+10) IndexAnyASCII/4096:4 45.7µs ± 2% 46.4µs ± 3% +1.37% (p=0.022 n=9+10) IndexAnyASCII/4096:8 46.4µs ± 3% 46.0µs ± 2% ~ (p=0.436 n=10+10) IndexAnyASCII/4096:16 46.6µs ± 3% 46.7µs ± 2% ~ (p=0.971 n=10+10) IndexPeriodic/IndexPeriodic2 1.40ms ± 3% 1.40ms ± 2% ~ (p=0.853 n=10+10) IndexPeriodic/IndexPeriodic4 1.40ms ± 3% 1.40ms ± 3% ~ (p=0.579 n=10+10) IndexPeriodic/IndexPeriodic8 1.42ms ± 3% 1.39ms ± 2% -1.60% (p=0.029 n=10+10) IndexPeriodic/IndexPeriodic16 616µs ± 5% 583µs ± 5% -5.32% (p=0.001 n=10+10) IndexPeriodic/IndexPeriodic32 313µs ± 5% 301µs ± 2% -3.67% (p=0.002 n=10+10) IndexPeriodic/IndexPeriodic64 169µs ± 5% 164µs ± 5% -3.17% (p=0.023 n=10+10) NodeJS version - 10.2.1 Change-Id: I9a8268314b5652c4aeffc4c5c72d2fd1a384aa9e Reviewed-on: https://go-review.googlesource.com/c/go/+/169777 Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
- 28 Mar, 2019 20 commits
-
-
Agniva De Sarker authored
The current algorithm only assumed line comments which always appear at the end of an import spec. This caused block comments which can appear before a spec to be attached to the previous spec. So while mapping a comment to an import spec, we maintain additional information on whether the comment is supposed to appear on the left or right of the spec. And we also take into account the possibility of "//line" comments in the source. So we use unadjusted line numbers. While at it, added some more testcases from tools/go/ast/astutil/imports_test.go Fixes #18929 Change-Id: If920426641702a8a93904b2ec1d3455749169f69 Reviewed-on: https://go-review.googlesource.com/c/go/+/162337 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
Josh Bleecher Snyder authored
When run with GOPATH=/dev/null, go build fails: $ GOPATH=/dev/null go test -run=TestLldbPython -v -count=1 runtime === RUN TestLldbPython --- FAIL: TestLldbPython (0.21s) runtime-lldb_test.go:169: building source exit status 1 go: failed to create cache directory /dev/null/pkg/mod/cache: mkdir /dev/null: not a directory FAIL FAIL runtime 0.220s But run.bash sets GOPATH=/dev/null. Fix this by setting GOPATH to the empty string before passing to 'go build'. Fixes #31100 Change-Id: I573c4755d209e0c3eb26c20d4f7870c2961f2782 Reviewed-on: https://go-review.googlesource.com/c/go/+/169918 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Josh Bleecher Snyder authored
Noticed while reading recent commits. Change-Id: Ibcd500b0ea5732364124572a17b374402d715090 Reviewed-on: https://go-review.googlesource.com/c/go/+/170059 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Jay Conrod authored
cmd/go/internal/imports.ScanDir extracts a list of imports from a directory. It's used instead of go/build.ImportDir when constructing the build list. GOOS and GOARCH may be used to filter files. With this change, imports.MatchFile understands that when the "android" tag is set, the "linux" tag is implied. Fixes #30888 Change-Id: Ia29bd1590b69c9183ab14a879d5fc1b639f8eaef Reviewed-on: https://go-review.googlesource.com/c/go/+/168378 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Josh Bleecher Snyder authored
Use constants that are easier to read. Change-Id: I11fd6363b3bd283a4cc7c9908c2327123c64dcf7 Reviewed-on: https://go-review.googlesource.com/c/go/+/169723 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Leonardo Comelli authored
The existing implementation does not check in all cases whether go.mod is a regular file. Fixes #30788 Change-Id: I6d140545c3cfada651612efd5bee2fbdcb747ca7 GitHub-Last-Rev: 4a9b251e378d9d7cc8768d395c360d3542fc9bc6 GitHub-Pull-Request: golang/go#30830 Reviewed-on: https://go-review.googlesource.com/c/go/+/167393 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
-
Daniel Cormier authored
Fixed textproto.Writer.DotWriter() to properly write \r\n.\r\n to the buffer when Close() is called without any bytes written. This properly writes the terminating sequence outlined in RFC 5321 section 4.1.1.4 and RFC 3977 section 3.1.1, even when no other bytes are written. Change-Id: I262fd2963ee76fff7ffae8e3cb0e86255694b361 Reviewed-on: https://go-review.googlesource.com/c/go/+/77350Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Richard Musiol authored
This change adds the GOWASM option "signext" to enable the generation of experimental sign-extension operators. The feature is in phase 4 of the WebAssembly proposal process: https://github.com/WebAssembly/meetings/blob/master/process/phases.md More information on the feature can be found at: https://github.com/WebAssembly/sign-extension-ops/blob/master/proposals/sign-extension-ops/Overview.md Change-Id: I6b30069390a8699fbecd9fb4d1d61e13c59b0333 Reviewed-on: https://go-review.googlesource.com/c/go/+/168882Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Eliminates global state from sinit.go. Passes toolstash-check. Updates #22326. Change-Id: Ie3cb14bff625baa20134d1488962ab02d24f0c15 Reviewed-on: https://go-review.googlesource.com/c/go/+/169899 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Clément Chigot authored
Fixes #27985 Change-Id: I2f3d06ced9da9fc56f30f1285a8d393e689c29ac Reviewed-on: https://go-review.googlesource.com/c/go/+/169019 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Matthew Dempsky authored
This will make it easier for subsequent CLs to track additional state during package initialization scheduling. Passes toolstash-check. Updates #22326. Change-Id: I528792ad34f41a4be52951531eb7525a94c9f350 Reviewed-on: https://go-review.googlesource.com/c/go/+/169898 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Joel Sing authored
cgotest attempts to exercise various linkmodes, however with recent refactoring TestCrossPackageTests is no longer running tests with these linkmodes. Specifying the linkmode via GOFLAGS restores previous behaviour. Note that the -ldflags="-linkmode=external -s" case cannot be passed through as GOFLAGS does not permit spaces in values and -ldflags can only be specified once. Fixes #31083. Change-Id: I2ce6c60da3f3d60495af283ea9122fb68a7a4f41 Reviewed-on: https://go-review.googlesource.com/c/go/+/169779 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Elias Naur authored
The specialized functions set up the g register using the pthread API instead of setg_gcc, but the inittls functions have already made sure setg_gcc works. Updates #29674 Change-Id: Ie67c068d638af8b5823978ee839f6b61b2228996 Reviewed-on: https://go-review.googlesource.com/c/go/+/169797Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Matthew Dempsky authored
Typechecking treats all untyped numbers as integers for the purposes of validating operators. However, when I refactoring constant operation evalution in golang.org/cl/139901, I mistakenly interpreted that the only invalid case that needed to be preserved was % (modulo) on floating-point values. This CL restores the other remaining cases that were dropped from that CL. It also uses the phrasing "invalid operation" instead of "illegal constant expression" for better consistency with the rest of cmd/compile and with go/types. Lastly, this CL extends setconst to recognize failed constant folding (e.g., division by zero) so that we can properly mark those expressions as broken rather than continuing forward with bogus values that might lead to further spurious errors. Fixes #31060. Change-Id: I1ab6491371925e22bc8b95649f1a0eed010abca6 Reviewed-on: https://go-review.googlesource.com/c/go/+/169719 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
-
LE Manh Cuong authored
Using os.UserHomeDir for user.HomeDir helps us deduplicate the logic and keep the behavior consistent. Also make os.UserHomeDir return "/sdcard" in android. See: https://go-review.googlesource.com/c/go/+/37960/1/src/os/user/lookup_stubs.go#48 Fixes #31070 Change-Id: I521bad050bc5761ecc5c0085501374d2cf8e6897 Reviewed-on: https://go-review.googlesource.com/c/go/+/169540 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Richard Musiol authored
This change modifies Value.String() to use the following representations for non-string values: <undefined> <null> <boolean: true> <number: 42> <symbol> <object> <function> It avoids JavaScript conversion semantics in the Go API and lowers the risk of hidden bugs by unexpected conversions, e.g. the conversion of the number 42 to the string "42". See discussion in #29642. This is a breaking change, which are still allowed for syscall/js. The impact should be small since it only affects uses of Value.String() with non-string values, which should be uncommon. Updates #29642. Change-Id: I2c27be6e24befe8cb713031fbf66f7b6041e7148 Reviewed-on: https://go-review.googlesource.com/c/go/+/169757 Run-TryBot: Richard Musiol <neelance@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Fixes #31096 Change-Id: I5b36bfc6d18eb8c1bbf15abcd92b0e6559cda3c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/169683Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
-
Josh Bleecher Snyder authored
Fixes #30751 Change-Id: I1f783578df499d52eaec3690303671661c8bf5fb Reviewed-on: https://go-review.googlesource.com/c/go/+/169725 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Josh Bleecher Snyder authored
Change-Id: I0a1ebaf41a1bc95508fd9aa782953ddca5ef49c9 Reviewed-on: https://go-review.googlesource.com/c/go/+/169724 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
David Chase authored
Code introduced in [2034fbab] cmd/compile: use existing instructions instead of nops for inline marks to change a src.Pos's column to 1 accidentally reset the is_stmt and prologue/epilogue bits, and that turned out to cause a regression in ssa/debug_test. Preserving that information fixed the regression. Change-Id: I7c6859c8b68d9c6f7c0cbc8805c1f41dc5c1d5fb Reviewed-on: https://go-review.googlesource.com/c/go/+/169739 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
-