summaryrefslogtreecommitdiff
path: root/src/go
Commit message (Collapse)AuthorAgeFilesLines
* go/ast: fix doc string for ast.GenDeclRobert Griesemer2016-11-291-1/+1
| | | | | | | | Fixes #18109. Change-Id: I5e3a44422794b7bae7741523fb7cacb6ba147af7 Reviewed-on: https://go-review.googlesource.com/33669 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* runtime/pprof: emit count profiles with debug=0 as proto profilesMichael Matloob2016-11-211-1/+1
| | | | | | | | | | | count profiles with debug=1 retain their previous format. Also add a test check for the proto profiles since all runtime/pprof tests only look at the debug=1 profiles. Change-Id: Ibe805585b597e5d3570807115940a1dc4535c03f Reviewed-on: https://go-review.googlesource.com/33148 Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* go/internal/gccgoimporter: handle conversions in exported const valuesRobert Griesemer2016-11-185-9/+48
| | | | | | | | | | Also: handle version "v2" of export data format. Fixes #17981. Change-Id: I8042ce18c4a27c70cc1ede675daca019b047bcf3 Reviewed-on: https://go-review.googlesource.com/33412 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* go/types: look at underlying type of element type of composite literals with ↵Robert Griesemer2016-11-182-12/+42
| | | | | | | | | | | | elided types Match behavior of gc and gccgo. For #17954. Change-Id: I3f065e56d0a623bd7642c1438d0cab94d23fa2ae Reviewed-on: https://go-review.googlesource.com/33358 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* runtime/pprof/internal: delete package gzip0Michael Matloob2016-11-111-1/+0
| | | | | | | | | | | | rsc's change golang.org/cl/32455 added a mechanism that allows pprof to depend on gzip without introducing an import cycle. This obsoletes the need for the gzip0 package, which was created solely to remove the need for that dependency. Change-Id: Ifa3b98faac9b251f909b84b4da54742046c4e3ad Reviewed-on: https://go-review.googlesource.com/33137 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* go/doc: don't panic if method is missing recv typeKeegan Carruthers-Smith2016-11-115-0/+37
| | | | | | | | Fixes #17788 Change-Id: I2f8a11321dc8f10bebbc8df90ba00ec65b9ee0fa Reviewed-on: https://go-review.googlesource.com/32790 Reviewed-by: Russ Cox <rsc@golang.org>
* cmd/go: don't set default GOPATH to GOROOTIan Lance Taylor2016-11-111-1/+7
| | | | | | | | | | | | It will just cause confusion later as the go tool will say "warning: GOPATH set to GOROOT (%s) has no effect". Better to just leave GOPATH unset and get that warning instead. Change-Id: I78ff9e87fdf4bb0460f4f6d6ee76e1becaa3e7b0 Reviewed-on: https://go-review.googlesource.com/33105 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* go/build: implement default GOPATHFrancesc Campoy2016-11-111-1/+14
| | | | | | | | | | | | | | | | | Whenever GOPATH is not defined in the environment, use $HOME/go as its default value. For Windows systems use %USERPROFILE%/go and $home/go for plan9. The choice of these environment variables is based on what Docker currently does. The os/user package is not used to avoid having a cgo dependency. Updates #17262. Documentation changes forthcoming. Change-Id: I6368fbfbc5afda99d6e64c35c1980076fcf45344 Reviewed-on: https://go-review.googlesource.com/32019 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* runtime/pprof: output CPU profiles in pprof protobuf formatMichael Matloob2016-11-101-1/+1
| | | | | | | | | | | | | | | | | This change buffers the entire profile and converts in one shot in the profile writer, and could use more memory than necessary to output protocol buffer formatted profiles. It should be possible to convert each chunk in a stream (maybe maintaining some minimal state to output in the end) which could save on memory usage. Fixes #16093 Change-Id: I946c6a2b044ae644c72c8bb2d3bd82c415b1a847 Reviewed-on: https://go-review.googlesource.com/33071 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* go/printer: don't drop required semi/linebreak after /*-commentRobert Griesemer2016-11-103-9/+71
| | | | | | | | | | | For details, see the issues. Fixes #11274. Fixes #15137. Change-Id: Ia11e71a054b3195e3007f490418a9c53a7e9cdf1 Reviewed-on: https://go-review.googlesource.com/33016 Reviewed-by: Alan Donovan <adonovan@google.com>
* go/types: remove unused alias-related testdata filesRobert Griesemer2016-11-102-132/+0
| | | | | | | | | | | | They interfere with gofmt -w across this directory. Follow-up on https://go-review.googlesource.com/32819. For #16339 (comment). Change-Id: I4298b6117d89517d4fe6addce3942d950d821817 Reviewed-on: https://go-review.googlesource.com/33019 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* runtime/pprof/internal: add package protopprofMichael Matloob2016-11-081-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds code, originally written by Russ Cox <rsc@golang.org> and open-sourced by Google, that converts from the "legacy" binary pprof profile format to a struct representation of the new protocol buffer pprof profile format. This code reads the entire binary format for conversion to the protobuf format. In a future change, we will update the code to incrementally read and convert segments of the binary format, so that the entire profile does not need to be stored in memory. This change also contains contributions by Daria Kolistratova <daria.kolistratova@intel.com> from the rolled-back change golang.org/cl/30556 adapting the code to be used by the package runtime/pprof. This code also appeared in the change golang.org/cl/32257, which was based on Daria Kolistratova's change, but was also rolled back. Updates #16093 Change-Id: I5c768b1134bc15408d80a3ccc7ed867db9a1c63d Reviewed-on: https://go-review.googlesource.com/32811 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* go/types: document that selectors are not recorded in Info.TypesRobert Griesemer2016-11-082-5/+9
| | | | | | | | Fixes #11944. Change-Id: I424ba93725f22fd599e052eb182f9ba2fca8e8bd Reviewed-on: https://go-review.googlesource.com/32881 Reviewed-by: Alan Donovan <adonovan@google.com>
* go/constant: follow-up for https://go-review.googlesource.com/32870Robert Griesemer2016-11-071-10/+14
| | | | | | | | For #17812. Change-Id: I58411aaa0e8b2250a16ddb20c951e39da3d601e8 Reviewed-on: https://go-review.googlesource.com/32872 Reviewed-by: Alan Donovan <adonovan@google.com>
* crypto/{cipher,tls,internal/cryptohw}: prioritise AES-GCM when hardware ↵Adam Langley2016-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | support is present. Support for ChaCha20-Poly1305 ciphers was recently added to crypto/tls. These ciphers are preferable in software, but they cannot beat hardware support for AES-GCM, if present. This change moves detection for hardware AES-GCM support into cipher/internal/cipherhw so that it can be used from crypto/tls. Then, when AES-GCM hardware is present, the AES-GCM cipher suites are prioritised by default in crypto/tls. (Some servers, such as Google, respect the client's preference between AES-GCM and ChaCha20-Poly1305.) Fixes #17779. Change-Id: I50de2be486f0b0b8052c4628d3e3205a1d54a646 Reviewed-on: https://go-review.googlesource.com/32871 Run-TryBot: Adam Langley <agl@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* go/constant: improved fatal error messagesRobert Griesemer2016-11-071-7/+5
| | | | | | | | Fixes #17812. Change-Id: I08202165dd3f72ae04420e7b6129b8b689e74f5c Reviewed-on: https://go-review.googlesource.com/32870 Reviewed-by: Alan Donovan <adonovan@google.com>
* go/constant: document that BinaryOp doesn't handle comparisons or shiftsRobert Griesemer2016-11-051-0/+3
| | | | | | | | Fixes #17797. Change-Id: I544df81c4bcf3cbd36a793be40050f14f9a9974f Reviewed-on: https://go-review.googlesource.com/32761 Reviewed-by: Dominik Honnef <dominik@honnef.co>
* Revert "go/scanner, go/token: recognize => (ALIAS) token"Robert Griesemer2016-11-053-9/+2
| | | | | | | | | | | | This reverts commit 776a90100f1f65fcf54dfd3d082d657341bdc323. Reason: Decision to back out current alias implementation. For #16339. Change-Id: Icb451a122c661ded05d9293356b466fa72b965f3 Reviewed-on: https://go-review.googlesource.com/32824 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* Revert "go/ast, go/parser: parse alias declarations"Robert Griesemer2016-11-055-96/+32
| | | | | | | | | | | | This reverts commit 57ae83307fc4cb90338b39dcc6fe3c61ee8ce0b7. Reason: Decision to back out current alias implementation. For #16339. Change-Id: I7bcc04ac87ea3590999e58ff65a7f2e1e6c6bc77 Reviewed-on: https://go-review.googlesource.com/32823 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* Revert "go/printer: support for printing alias declarations"Robert Griesemer2016-11-053-147/+7
| | | | | | | | | | | | This reverts commit 59c63c711c73f3872c3047c2e80debba5ff1b802. Reason: Decision to back out current alias implementation. For #16339. Change-Id: Idd135fe84b7ce4814cb3632f717736fc6985634c Reviewed-on: https://go-review.googlesource.com/32822 Reviewed-by: Chris Manghane <cmang@golang.org>
* cmd/compile: revert user-visible changes related to aliasesRobert Griesemer2016-11-041-22/+1
| | | | | | | | | | | | | | Reason: Decision to back out current alias implementation. Leaving import/export related code in place for now. For #16339. TBR=mdempsky Change-Id: Ib0897cab2c1c3dc8a541f2efb9893271b0b0efe2 Reviewed-on: https://go-review.googlesource.com/32757 Reviewed-by: Robert Griesemer <gri@golang.org>
* go/types: revert user-visible changes related to aliasesRobert Griesemer2016-11-047-38/+46
| | | | | | | | | Reason: Decision to back out current alias implementation. For #16339 (comment). Change-Id: Ie04f24e529db2d29c5dd2e36413f5f37f628df39 Reviewed-on: https://go-review.googlesource.com/32819 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* go/types: avoid redundant call to recordUse for anonymous fieldsAlan Donovan2016-11-041-9/+5
| | | | | | | | | | Anonymous fields are type expressions, and Checker.typexpr already correctly records uses within them. There's no need for a second call, and the second call caused a bug when we implemented aliases. Change-Id: I1bf2429cd4948d68b085e75dfb1bdc03ad8caffd Reviewed-on: https://go-review.googlesource.com/32837 Reviewed-by: Robert Griesemer <gri@golang.org>
* all: sprinkle t.Parallel on some slow testsBrad Fitzpatrick2016-11-041-22/+33
| | | | | | | | | | | | | | | | | I used the slowtests.go tool as described in https://golang.org/cl/32684 on packages that stood out. go test -short std drops from ~56 to ~52 seconds. This isn't a huge win, but it was mostly an exercise. Updates #17751 Change-Id: I9f3402e36a038d71e662d06ce2c1d52f6c4b674d Reviewed-on: https://go-review.googlesource.com/32751 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* testing: add T.Context methodBrad Fitzpatrick2016-11-031-1/+1
| | | | | | | | | | | | | | | | | From the doc comment: Context returns the context for the current test or benchmark. The context is cancelled when the test or benchmark finishes. A goroutine started during a test or benchmark can wait for the context's Done channel to become readable as a signal that the test or benchmark is over, so that the goroutine can exit. Fixes #16221. Fixes #17552. Change-Id: I657df946be2c90048cc74615436c77c7d9d1226c Reviewed-on: https://go-review.googlesource.com/31724 Reviewed-by: Rob Pike <r@golang.org>
* testing: mark tests and benchmarks failed if a race occurs during executionRuss Cox2016-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: $ go test -race -v -run TestRace === RUN TestRace ================== WARNING: DATA RACE Write at 0x00c420076420 by goroutine 7: _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace.func1() /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:10 +0x3b Previous write at 0x00c420076420 by goroutine 6: _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace() /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:13 +0xcc testing.tRunner() /Users/rsc/go/src/testing/testing.go:656 +0x104 Goroutine 7 (running) created at: _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace() /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:12 +0xbb testing.tRunner() /Users/rsc/go/src/testing/testing.go:656 +0x104 Goroutine 6 (running) created at: testing.(*T).Run() /Users/rsc/go/src/testing/testing.go:693 +0x536 testing.runTests.func1() /Users/rsc/go/src/testing/testing.go:877 +0xaa testing.tRunner() /Users/rsc/go/src/testing/testing.go:656 +0x104 testing.runTests() /Users/rsc/go/src/testing/testing.go:883 +0x4ac testing.(*M).Run() /Users/rsc/go/src/testing/testing.go:818 +0x1c3 main.main() _/Users/rsc/go/src/cmd/go/testdata/src/testrace/_test/_testmain.go:42 +0x20f ================== --- PASS: TestRace (0.00s) PASS Found 1 data race(s) FAIL _/Users/rsc/go/src/cmd/go/testdata/src/testrace 1.026s $ After: $ go test -race -v -run TestRace === RUN TestRace ================== WARNING: DATA RACE Write at 0x00c420076420 by goroutine 7: _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace.func1() /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:10 +0x3b Previous write at 0x00c420076420 by goroutine 6: _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace() /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:13 +0xcc testing.tRunner() /Users/rsc/go/src/testing/testing.go:656 +0x104 Goroutine 7 (running) created at: _/Users/rsc/go/src/cmd/go/testdata/src/testrace.TestRace() /Users/rsc/go/src/cmd/go/testdata/src/testrace/race_test.go:12 +0xbb testing.tRunner() /Users/rsc/go/src/testing/testing.go:656 +0x104 Goroutine 6 (running) created at: testing.(*T).Run() /Users/rsc/go/src/testing/testing.go:693 +0x536 testing.runTests.func1() /Users/rsc/go/src/testing/testing.go:877 +0xaa testing.tRunner() /Users/rsc/go/src/testing/testing.go:656 +0x104 testing.runTests() /Users/rsc/go/src/testing/testing.go:883 +0x4ac testing.(*M).Run() /Users/rsc/go/src/testing/testing.go:818 +0x1c3 main.main() _/Users/rsc/go/src/cmd/go/testdata/src/testrace/_test/_testmain.go:42 +0x20f ================== --- FAIL: TestRace (0.00s) testing.go:609: race detected during execution of test FAIL FAIL _/Users/rsc/go/src/cmd/go/testdata/src/testrace 0.022s $ Fixes #15972. Change-Id: Idb15b8ab81d65637bb535c7e275595ca4a6e450e Reviewed-on: https://go-review.googlesource.com/32615 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* go/internal/gcimporter: backport changes from x/tools/go/gcimporter15Robert Griesemer2016-11-031-6/+10
| | | | | | | | | | | | | See https://go-review.googlesource.com/32581. This makes x/tools/go/gcimporter15/bimport.go a close copy again and the importer more robust. Change-Id: If96ad6acd611878b7dfa6a13d005d847ece82ab6 Reviewed-on: https://go-review.googlesource.com/32647 TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* go/types: set up correct type with NewAliasRobert Griesemer2016-11-022-2/+10
| | | | | | Change-Id: I4b035b3539c98e5b1442d1009d457cbc199b42ee Reviewed-on: https://go-review.googlesource.com/32637 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile: avoid double export of aliased objectsMatthew Dempsky2016-11-021-31/+20
| | | | | | | | | | | | | | | Instead of writing out the original object for each alias, ensure we export the original object before any aliases. This allows the aliases to simply refer back to the original object by qualified name. Fixes #17636. Change-Id: If80fa8c66b8fee8344a00b55d25a8aef22abd859 Reviewed-on: https://go-review.googlesource.com/32575 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* testing: introduce testing/internal/testdeps for holding testmain dependenciesRuss Cox2016-11-021-46/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we don't have package testing to import package regexp directly, because then regexp can't have internal tests (or at least they become more difficult to write), for fear of an import cycle. The solution we've been using is for the generated test main package (pseudo-import path "testmain", package main) to import regexp and pass in a matchString function for use by testing when implementing the -run flags. This lets testing use regexp but without depending on regexp and creating unnecessary cycles. We want to add a few dependencies to runtime/pprof, notably regexp but also compress/gzip, without causing those packages to have to work hard to write internal tests. Restructure the (dare I say it) dependency injection of regexp.MatchString to be more general, and use it for the runtime/pprof functionality in addition to the regexp functionality. The new package testing/internal/testdeps is the root for the testing dependencies handled this way. Code using testing.MainStart will have to change from passing in a matchString implementation to passing in testdeps.TestDeps{}. Users of 'go test' don't do this, but other build systems that have recreated 'go test' (for example, Blaze/Bazel) may need to be updated. The new testdeps setup should make future updates unnecessary, but even so we keep the comment about MainStart not being subject to Go 1 compatibility. Change-Id: Iec821d2afde10c79f95f3b23de5e71b219f47b92 Reviewed-on: https://go-review.googlesource.com/32455 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* internal/pprof/profile: new package, moved from cmd/internal/pprof/profileRuss Cox2016-11-021-0/+1
| | | | | | | | | | This allows both the runtime and the cmd/pprof code to use the package, just like we do for internal/trace. Change-Id: I7606977284e1def36c9647354c58e7c1e93dba6b Reviewed-on: https://go-review.googlesource.com/32452 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* go/importer: handle multiple imports of the same objectRobert Griesemer2016-11-013-20/+56
| | | | | | | | | | | | | | Before aliases, and because we chose a simple export format for them, a package may now export the same object more than once if there are multiple exported aliases referring to that object. The go/importer made the assumption this couldn't happen. Adjust it. Fixes #17726. Change-Id: Ibb9fc669a8748200b45ad78934d7453e5a5aad82 Reviewed-on: https://go-review.googlesource.com/32538 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Robert Griesemer <gri@golang.org>
* go/types: handle imported aliasesRobert Griesemer2016-11-015-8/+119
| | | | | | | | | | | | When we lookup a qualified identifier, we need to unpack an alias. Do this in all places, not just one. Duh! Fixes #17716. For #17592. Change-Id: I58d57b17cc635d0408b370f109c719c16757fd8e Reviewed-on: https://go-review.googlesource.com/32534 Reviewed-by: Alan Donovan <adonovan@google.com>
* cmd/compile: add debug print to identify unexpected objectsRobert Griesemer2016-11-011-0/+1
| | | | | | | | | | This should never be called but should help identify causes of unexpected panics such as in issue #17716. Change-Id: Id6ad0cef1088a41bfcc69110a93484a7e39c4128 Reviewed-on: https://go-review.googlesource.com/32480 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* go/types: basic Defs/Uses test for aliasesRobert Griesemer2016-10-311-0/+83
| | | | | | | | Change-Id: I113ea712838511ee823375d9ea059089195414f5 Reviewed-on: https://go-review.googlesource.com/32449 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* go/types: implement missing String method for Alias objectRobert Griesemer2016-10-311-0/+1
| | | | | | Change-Id: Iba5cfa033483b843dbd3681ffad50b117cced4a7 Reviewed-on: https://go-review.googlesource.com/32448 Reviewed-by: Alan Donovan <adonovan@google.com>
* go/types: don't expose types.Alias kind field - only used by go/typesRobert Griesemer2016-10-313-8/+10
| | | | | | Change-Id: I8a28a88a655d9929f8641f71573dc01dc53be00f Reviewed-on: https://go-review.googlesource.com/32443 Reviewed-by: Alan Donovan <adonovan@google.com>
* go/importer: implement importing of exported aliasesRobert Griesemer2016-10-312-5/+45
| | | | | | | | | | Fixes #17592. Change-Id: I914fa8c0729012990878b6e5c3e99b0f9b0e2be8 Reviewed-on: https://go-review.googlesource.com/32350 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* go/build: add back deps for runtime/pprof/internal/gzip0Michael Matloob2016-10-311-6/+7
| | | | | | | | These were accidentally removed by a rollback cl: golang.org/cl/32441 Change-Id: I0cfa8b3397be324dabfb8f33b6548a03c10571eb Reviewed-on: https://go-review.googlesource.com/32334 Reviewed-by: Alan Donovan <adonovan@google.com>
* Revert "runtime/pprof: write profiles in protobuf format."Michael Matloob2016-10-311-9/+6
| | | | | | | | | | | This reverts commit b33030a72754cb55d6ec137e79facacb398c9be4. Reason for revert: We're going to try to get the code in this change submitted in smaller, more carefully reviewed changes. Change-Id: I4175f4b297f0e69fb78b11f9dc0bd82f27865be7 Reviewed-on: https://go-review.googlesource.com/32441 Reviewed-by: Russ Cox <rsc@golang.org>
* go/types: local type-checking of alias declarationsRobert Griesemer2016-10-317-24/+234
| | | | | | | | | | Does not handle imports of packages with exported aliases yet. For #17592. Change-Id: Iee63fb9d521014995003a417271fbe0384ae04ef Reviewed-on: https://go-review.googlesource.com/32108 Reviewed-by: Alan Donovan <adonovan@google.com>
* database/sql: add context helper methods and transaction typesDaniel Theophanes2016-10-301-2/+2
| | | | | | | | | | | | | | | Prior to this change, it was implied that transaction properties would be carried in the context value. However, no such properties were defined, not even common ones. Define two common properties: isolation level and read-only. Drivers may choose to support additional transaction properties. It is not expected any further transaction properties will be added in the future. Change-Id: I2f680115a14a1333c65ba6f943d9a1149d412918 Reviewed-on: https://go-review.googlesource.com/31258 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* runtime/pprof/internal/gzip0: new package for pprofRuss Cox2016-10-291-0/+1
| | | | | | | | | | | Writes gzip-format uncompressed files. Change-Id: Id5dc01852e21732978700fd9efcc2d4a5899ffeb Reviewed-on: https://go-review.googlesource.com/32260 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com> Reviewed-by: Michael Matloob <matloob@golang.org>
* runtime/pprof: write profiles in protobuf format.Michael Matloob2016-10-281-6/+8
| | | | | | | | | | | | | | | | | Original Change by Daria Kolistratova <daria.kolistratova@intel.com> Added functions with suffix proto and stuff from pprof tool to translate to protobuf. Done as the profile proto is more extensible than the legacy pprof format and is pprof's preferred profile format. Large part was taken from https://github.com/google/pprof tool. Tested by hand and compared the result with translated by pprof tool, profiles are identical. Fixes #16093 Change-Id: I2751345b09a66ee2b6aa64be76cba4cd1c326aa6 Reviewed-on: https://go-review.googlesource.com/32257 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* cmd/go, go/build: document form of import pathsRuss Cox2016-10-281-3/+8
| | | | | | | | Fixes #16164. Change-Id: Ic8f51ebd8235640143913a07b70f5b41ee061fe4 Reviewed-on: https://go-review.googlesource.com/32114 Reviewed-by: Quentin Smith <quentin@golang.org>
* Revert "runtime/pprof: write profiles in protobuf format."Austin Clements2016-10-281-8/+6
| | | | | | | | | | This reverts commit 7d14401bcbee4a8ff33ac869ef5ebb156a179ab6. Reason for revert: Doesn't build. Change-Id: I766179ab9225109d9232f783326e4d3843254980 Reviewed-on: https://go-review.googlesource.com/32256 Reviewed-by: Russ Cox <rsc@golang.org>
* runtime/pprof: write profiles in protobuf format.unknown2016-10-281-6/+8
| | | | | | | | | | | | | | Added functions with suffix proto and stuff from pprof tool to translate to protobuf. Done as the profile proto is more extensible than the legacy pprof format and is pprof's preferred profile format. Large part was taken from https://github.com/google/pprof tool. Tested by hand and compared the result with translated by pprof tool, profiles are identical. Fixes #16093 Change-Id: I5acdb2809cab0d16ed4694fdaa7b8ddfd68df11e Reviewed-on: https://go-review.googlesource.com/30556 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org>
* cmd/compile, go/parser: disallow "type T = p.T" - must use "=>"Robert Griesemer2016-10-274-7/+2
| | | | | | | | | | | | | I had added this originally so we can play with different notations but it doesn't make sense to keep it around since gofmt will convert a type alias declaration using "=" into one using "=>" anyhow. More importantly, the spec doesn't permit it. Change-Id: Icb010b5a9976aebf877e48b3ce9d7245559ca494 Reviewed-on: https://go-review.googlesource.com/32105 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/compile: import/export of alias declarationsRobert Griesemer2016-10-271-2/+2
| | | | | | | | | | | | | | | | | This CL completes support for alias declarations in the compiler. Also: - increased export format version - updated various comments For #16339. Fixes #17487. Change-Id: Ic6945fc44c0041771eaf9dcfe973f601d14de069 Reviewed-on: https://go-review.googlesource.com/32090 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* go/scanner: recognize invalid floating-point constant exponentRobert Griesemer2016-10-262-1/+6
| | | | | | | | Fixes #17621. Change-Id: Id3e75c9b7fba2cf8e791c8817f890556ca238e9d Reviewed-on: https://go-review.googlesource.com/32096 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>