summaryrefslogtreecommitdiff
path: root/src/go
Commit message (Collapse)AuthorAgeFilesLines
* ast: make ExampleCommentMap a runnable examplecloss2017-07-161-14/+9
| | | | | | | | | | Fixes #20450 Change-Id: I2256282a8880e99508e98fefedfb94a7cccacbcf Reviewed-on: https://go-review.googlesource.com/48969 Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
* crypto/x509: load all trusted certs on darwin (nocgo)Nathaniel Caza2017-07-141-1/+1
| | | | | | | | | | | | | | | | | | The current implementation ignores certificates that exist in the login and System keychains. This change adds the missing System and login keychain files to the `/usr/bin/security` command in `execSecurityRoots`. If the current user cannot be obtained, the login keychain is ignored. Refs #16532 Change-Id: I8594a6b8940c58df8a8015b274fa45c39e18862c Reviewed-on: https://go-review.googlesource.com/36941 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* testing: roll back CL 44352 (show in-progress tests upon SIGINT)Ian Lance Taylor2017-07-131-1/+1
| | | | | | | | | | | | | | | | CL 44352 changed the behavior of SIGINT, which can break tests that themselves use SIGINT. I think we can only implement this if the testing package has a way to know whether the code under test is using SIGINT, but os/signal does not provide an API for that. Roll back for 1.9 and think about this again for 1.10. Updates #19397 Change-Id: I021c314db2b9d0a80d0088b120a6ade685459990 Reviewed-on: https://go-review.googlesource.com/48370 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* go/printer: fix typoKale Blankenship2017-07-041-1/+1
| | | | | | Change-Id: Idf89559c9945c5a8743539658fe92e860fcc6a92 Reviewed-on: https://go-review.googlesource.com/47362 Reviewed-by: Matt Layher <mdlayher@gmail.com>
* go/importer: don't return packages that are not fully type-checkedRobert Griesemer2017-06-281-2/+5
| | | | | | | | Fixes #20837. Change-Id: I266519c26c8849da267b77e11abe7734d8275112 Reviewed-on: https://go-review.googlesource.com/47074 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* go/ast: improve comment on FuncDecl.BodyAlan Donovan2017-06-281-1/+1
| | | | | | | | "Forward declaration" suggests that declarations must precede calls. Change-Id: I1b3a26b58f52a39bc11d75696df928a6b66c7313 Reviewed-on: https://go-review.googlesource.com/47073 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* go/types: prevent crash in type cycles involving non-type expressionsRobert Griesemer2017-06-232-1/+32
| | | | | | | | | Fixes #18643. Change-Id: I36dca943d552a178a71094ff883b0319fe03d130 Reviewed-on: https://go-review.googlesource.com/46467 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* go/types: more robust operand printingRobert Griesemer2017-06-221-6/+8
| | | | | | | | | | | | Not a fix but useful for further debugging, and safe. For #18643. Change-Id: I5fb4f4a8662007a26e945fff3986347855f00eab Reviewed-on: https://go-review.googlesource.com/46393 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* go/ast: improved documentation for comments associated with an ASTRobert Griesemer2017-06-211-0/+13
| | | | | | | | Fixes #18593. Change-Id: Ibe33ad9b536fee909120b3654b9d831e469eb285 Reviewed-on: https://go-review.googlesource.com/46370 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* cmd/gofmt, go/printer: fix mis-alignment of comment on one-line functionRobert Griesemer2017-06-193-1/+24
| | | | | | | | Fixes #19544. Change-Id: I5df67383e9471f030ddafabadf2bc19ce6816f0f Reviewed-on: https://go-review.googlesource.com/46002 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* go/token: use fine-grained locking in FileSetAlan Donovan2017-06-142-19/+35
| | | | | | | | | | | | | | | | | Before, all accesses to the lines and infos tables of each File were serialized by the lock of the owning FileSet, causing parsers running in parallel to contend. Now, each File has its own mutex. This fixes a data race in (*File).PositionFor, which used to call f.position then f.unpack without holding the mutex's lock. Fixes golang/go#18348 Change-Id: Iaa5989b2eba88a7fb2e91c1a0a8bc1e7f6497f2b Reviewed-on: https://go-review.googlesource.com/34591 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* go/printer: handle associated comments for CommentedNodeHiroshi Ioka2017-06-142-0/+78
| | | | | | | | | | | | | | | Current CommentedNode cannot handle associated comments which satisfy node.End() < comment.Pos() This CL solves it. Fixes #20635 Change-Id: I58e2e3703999bb38a6ce37112e986c4b1b2eace0 Reviewed-on: https://go-review.googlesource.com/45292 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* go/build: make -I/-L options in cgo flags absoluteIan Lance Taylor2017-06-131-0/+37
| | | | | | | | | | Fixes #20266. Change-Id: I51383820880e3d3566ef3d70650a0863756003ba Reviewed-on: https://go-review.googlesource.com/44291 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* go/parser: handle last line commentsHiroshi Ioka2017-06-122-1/+16
| | | | | | | | | | Fixes #20636 Change-Id: Icea0012fecb73944c95f6037922505c63b57b245 Reviewed-on: https://go-review.googlesource.com/45295 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* testing: show in-progress tests upon SIGINTMeir Fischer2017-06-091-1/+1
| | | | | | | | | | | | | | | | | | | Because of parallel tests, which have stalled executions, the RUN output of a test can be much earlier than its completion output resulting in hard-to-read verbose output. The tests are displayed in the order in which the output shows that they began, to make it easy to line up with the "RUN" output. Similarly, the definitions of when tests begin and complete is determined by when RUN and FAIL/SKIP/PASS are output since the focus of this code is on enhancing readability. Fixes #19397 Change-Id: I4d0ca3fd268b620484e7a190117f79a33b3dc461 Reviewed-on: https://go-review.googlesource.com/44352 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* go/types: adjust type-checking of shifts to match compilersRobert Griesemer2017-06-082-9/+15
| | | | | | | | For #14822. Change-Id: Ia3f5558f3e0dcb8ee2dab54a6e9588eecc22511f Reviewed-on: https://go-review.googlesource.com/45074 Reviewed-by: Alan Donovan <adonovan@google.com>
* cmd/compile: reject unknown //go: comments in std libraryKeith Randall2017-06-061-3/+3
| | | | | | | | | | | Fixes #18331 Change-Id: Ie5c6685be3002533b84604ff1f13f2f0850f29e2 Reviewed-on: https://go-review.googlesource.com/45010 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
* go/types: don't panic in complex divisionAlberto Donizetti2017-06-052-5/+18
| | | | | | | | | | | | | | | | Make sure that in complex division we reject divisors that would underflow to zero when using the textbook complex-division method we currently use. This change does for go/types what golang.org/cl/42650 did for gc. Fixes #20227 Change-Id: Iaa784ac5e60141f51c501eb0e3ce0e9c1c2993d0 Reviewed-on: https://go-review.googlesource.com/44590 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* go/printer: don't emit unnecessary //line directives before empty linesRobert Griesemer2017-06-022-13/+66
| | | | | | | | | | | | | | | | | | | | | | 1) Split atLineBegin into its two components: writing of // line directives and writing of indentation (no functionality changes). 2) Don't call writeLineDirective at the beginning of a line if we're writing white space - it's not necessary. This is the bug fix. 3) Move testing of the SourcePos mode out of writeLineDirective and into the (single) caller. Clearer and more efficient. (Instead of these 3 changes one could also have simply called the original atLineBegin with position p.out rather than p.pos. This would have caused atLineBegin to not write a line directive. Factoring the code seemed like a cleaner and more direct approach.) Fixes #5945. Change-Id: Ia8710806b6d3d4e5044116b142c036a4ab5a1764 Reviewed-on: https://go-review.googlesource.com/44651 Reviewed-by: Alan Donovan <adonovan@google.com>
* cmd/compile: don't generate liveness maps when the stack is too largeJosh Bleecher Snyder2017-05-301-0/+1
| | | | | | | | | | Fixes #20529 Change-Id: I3cb0c037b1737fbc3fa3b1b61ed8a42cfaf8e10d Reviewed-on: https://go-review.googlesource.com/44344 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
* cmd/compile: don't panic in complex divisionAlberto Donizetti2017-05-181-0/+1
| | | | | | | | | | Updates #20227 Change-Id: Idadc3137490181a5d380367660cee21e8313cf3b Reviewed-on: https://go-review.googlesource.com/42650 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* go/types: fewer spurious "declared but not used" follow-on errorsRobert Griesemer2017-05-153-1/+37
| | | | | | | | | | | | Mark variables as used even when they appear within an expression context which we can't type-check; e.g., because the expression is erroneous, or comes from an import "C" declaration. Fixes #20358. Change-Id: Ib28cc78d3867c597c7a1ace54de09ada02f5b33a Reviewed-on: https://go-review.googlesource.com/43500 Reviewed-by: Alan Donovan <adonovan@google.com>
* go/build: return partial information on Import error, for local import pathsDmitri Shuralyov2017-05-152-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation of build.Import says: // If the path is a local import path naming a package that can be imported // using a standard import path, the returned package will set p.ImportPath // to that path. // ... // If an error occurs, Import returns a non-nil error and a non-nil // *Package containing partial information. That behavior was previously untested, and broken by change in CL 33158. Fix that by avoiding returning early on error for local import paths. First, gather partial information, and only then check that the p.Dir directory exists. Add tests for this behavior. Fixes #19769. Fixes #20175 (duplicate of #19769). Updates #17863. Change-Id: I169cb35291099d05e02aaa3cb23a7403d1cc3657 Reviewed-on: https://go-review.googlesource.com/42350 Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* net: allow Resolver to use a custom dialerMatt Harden2017-05-121-1/+1
| | | | | | | | | | | | | | | | | | In some cases it is desirable to customize the way the DNS server is contacted, for instance to use a specific LocalAddr. While most operating-system level resolvers do not allow this, we have the opportunity to do so with the Go resolver. Most of the code was already in place to allow tests to override the dialer. This exposes that functionality, and as a side effect eliminates the need for a testing hook. Fixes #17404 Change-Id: I1c5e570f8edbcf630090f8ec6feb52e379e3e5c0 Reviewed-on: https://go-review.googlesource.com/37260 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* go/build: accept spaces in cgo directivesHiroshi Ioka2017-05-102-15/+9
| | | | | | | | | | Fixes #7906 Change-Id: Ibcf9cd670593241921ab3c426ff7357f799ebc3e Reviewed-on: https://go-review.googlesource.com/43072 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* internal/cpu: new package to detect cpu featuresMartin Möhrmann2017-05-101-1/+3
| | | | | | | | | | | | | | | | | Implements detection of x86 cpu features that are used in the go standard library. Changes all standard library packages to use the new cpu package instead of using runtime internal variables to check x86 cpu features. Updates: #15403 Change-Id: I2999a10cb4d9ec4863ffbed72f4e021a1dbc4bb9 Reviewed-on: https://go-review.googlesource.com/41476 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* cmd/compile: make "imported and not used" errors deterministicJosh Bleecher Snyder2017-05-091-2/+13
| | | | | | | | | | | | | | | | If there were more unused imports than the maximum default number of errors to report, the set of reported imports was non-deterministic. Fix by accumulating and sorting them prior to output. Fixes #20298 Change-Id: Ib3d5a15fd7dc40009523fcdc1b93ddc62a1b05f2 Reviewed-on: https://go-review.googlesource.com/42954 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* go/token: remove excess parenthesis in NoPos.IsValid() documentationIbrahim AshShohail2017-05-091-1/+1
| | | | | | | | Fixes #20294 Change-Id: I32ac862fe00180210a04103cc94c4d9fef5d1b6c Reviewed-on: https://go-review.googlesource.com/42992 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/compile: better errors for float constants with large exponentsRobert Griesemer2017-05-081-0/+1
| | | | | | | | | | | | Also: Removed misleading comment. Fixes #20232. Change-Id: I0b141b1360ac53267b7ebfcec7a2e2a238f3f46c Reviewed-on: https://go-review.googlesource.com/42930 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* go/types: remove invalid documentation and assertion on package namesRobert Griesemer2017-05-052-5/+7
| | | | | | | | | | | | | | | | | | | | | | NewPackage required through documentation that the package name not be blank (which wasn't true since each time we check a new package we create one with a blank name (api.go:350). NewPackage also asserted that a package name not be "_". While it is invalid for a package name to be "_", one could conceivably create a package named "_" through export data manipulation. Furthermore, it is ok to import a package with package path "_" as long as the package itself is not named "_". - removed misleading documentation - removed unnecessary assertion - added safety checks when we actually do the import Fixes #20231. Change-Id: I1eb1ab7b5e3130283db715374770cf05d749d159 Reviewed-on: https://go-review.googlesource.com/42852 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* go/importer: report import path if package is not foundRobert Griesemer2017-05-051-1/+2
| | | | | | | | | | Fixes #20230. Change-Id: I2e9b9e9d2540eb66c8411ac7910962933bc2c0e9 Reviewed-on: https://go-review.googlesource.com/42870 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
* go/constant: avoid generating rats for large negative exponentsJosh Bleecher Snyder2017-05-042-1/+9
| | | | | | | | Fixes #20228 Change-Id: I1893ae3e192da01f9befe5469b2a32e534a691ba Reviewed-on: https://go-review.googlesource.com/42592 Reviewed-by: Robert Griesemer <gri@golang.org>
* go/internal/gcimporter: add test object files for go1.8 versions 4 and 5Josh Bleecher Snyder2017-04-252-0/+0
| | | | | | | | | | | Version 4 generated with toolchain at commit 51012314251a8b1f1dfe9737091a37c0e1f6b9d5. Version 5 generated with toolchain at commit a6b16e00240ca5ca0161f88819ef32f91f6af52c. Change-Id: If11ec8b3357f0f71776c15665e4d5228b3842ff7 Reviewed-on: https://go-review.googlesource.com/41710 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* cmd/compile: improve efficiency of binary export position encodingJosh Bleecher Snyder2017-04-251-25/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use -64 instead of 0 as the magic "new file" line delta, since it is much less common. Use a new path encoding that breaks up paths into /-separated components, allowing reuse of the component strings, and making many re-used paths a single byte to encode. Bump the export version to 5. Fixes #20080 name old export-bytes new export-bytes delta Template 19.1k ± 0% 17.4k ± 0% -8.74% (p=0.008 n=5+5) Unicode 4.47k ± 0% 4.42k ± 0% -0.96% (p=0.008 n=5+5) GoTypes 29.9k ± 0% 27.6k ± 0% -7.41% (p=0.008 n=5+5) Compiler 71.4k ± 0% 65.4k ± 0% -8.45% (p=0.008 n=5+5) SSA 67.8k ± 0% 65.6k ± 0% -3.38% (p=0.008 n=5+5) Flate 4.99k ± 0% 4.79k ± 0% -3.91% (p=0.008 n=5+5) GoParser 8.77k ± 0% 7.97k ± 0% -9.14% (p=0.008 n=5+5) Reflect 6.27k ± 0% 6.13k ± 0% -2.22% (p=0.008 n=5+5) Tar 9.46k ± 0% 8.82k ± 0% -6.69% (p=0.008 n=5+5) XML 16.0k ± 0% 14.9k ± 0% -6.69% (p=0.008 n=5+5) [Geo mean] 14.8k 14.0k -5.80% Change-Id: Iea0c8c62e61dbab3cfd14ee121e34845c85f00d2 Reviewed-on: https://go-review.googlesource.com/41619 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* all: remove some unused parameters in test codeDaniel Martí2017-04-252-4/+4
| | | | | | | | | | | | Mostly unnecessary *testing.T arguments. Found with github.com/mvdan/unparam. Change-Id: Ifb955cb88f2ce8784ee4172f4f94d860fa36ae9a Reviewed-on: https://go-review.googlesource.com/41691 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* go/gcimporter: fix importing of anonymous interfacesRobert Griesemer2017-04-203-36/+61
| | | | | | | | | | | | | | | | | Imported interfaces must be completed, whether they are named or not. The original code was collecting all types (including anonymous ones) in the importer's typList. That list was used in the end to complete interface types. When we introduced tracking of named types only, we lost anonymous interfaces. Use an independent list of interface types so the completion code is independent of which types are tracked. Added test and factored some of the existing tests. Fixes #20046. Change-Id: Icd1329032aec33f96890380dd5042de3bef8cdc7 Reviewed-on: https://go-review.googlesource.com/41198 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
* all: remove redundant returnsDaniel Martí2017-04-191-4/+0
| | | | | | | | | | | Returns at the end of func bodies where the funcs have no return values are pointless. Change-Id: I0da5ea78671503e41a9f56dd770df8c919310ce5 Reviewed-on: https://go-review.googlesource.com/41093 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* go/format: quote bytes in comments for readabilityxufei_Alex2017-04-191-4/+4
| | | | | | Change-Id: I8e90012b3498c51aaeb2f70182debab52549afb4 Reviewed-on: https://go-review.googlesource.com/40930 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: remove unnecessary ", _" from map readsDaniel Martí2017-04-181-1/+1
| | | | | | | | | | | | If the bool value isn't used, there is no need to assign to underscore - there is a shorter form that only returns the value and behaves in the exact same way. Change-Id: Iaf801b8e966da6c2f565bc39e3bb028175c92d60 Reviewed-on: https://go-review.googlesource.com/40920 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* net/http/fcgi: expose cgi env vars in request contextMeir Fischer2017-04-131-1/+1
| | | | | | | | | | | | | | | | | | | | | The current interface can't access all environment variables directly or via cgi.RequestFromMap, which only reads variables on its "white list" to be set on the http.Request it returns. If an fcgi variable is not on the "white list" - e.g. REMOTE_USER - the old code has no access to its value. This passes variables in the Request context that aren't used to add data to the Request itself and adds a method that parses those env vars from the Request's context. Fixes #16546 Change-Id: Ibf933a768b677ece1bb93d7bf99a14cef36ec671 Reviewed-on: https://go-review.googlesource.com/40012 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* all: fix minor misspellingsEric Lagergren2017-04-031-1/+1
| | | | | | | | Change-Id: I1f1cfb161640eb8756fb1a283892d06b30b7a8fa Reviewed-on: https://go-review.googlesource.com/39356 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* go/parser: fix example to run on the playgroundDaniel Martí2017-04-031-5/+14
| | | | | | | | | | | | | | | | The example shouldn't rely on the existance of example_test.go. That breaks in the playground, which is what the "run" button in https://golang.org/pkg/go/parser/#example_ParseFile does. Make the example self-sufficient by using a small piece of source via a string literal instead. Fixes #19823. Change-Id: Ie8a3c6c5d00724e38ff727862b62e6a3621adc88 Reviewed-on: https://go-review.googlesource.com/39236 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Robert Griesemer <gri@golang.org>
* testing/quick: generate all possible int64, uint64 valuesRuss Cox2017-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | When generating a random int8, uint8, int16, uint16, int32, uint32, quick.Value chooses among all possible values. But when generating a random int64 or uint64, it only chooses values in the range [-2⁶², 2⁶²) (even for uint64). It should, like for all the other integers, use the full range. If it had, this would have caught #19807 earlier. Instead it let us discover the presence of #19809. While we are here, also make the default source of randomness not completely deterministic. Fixes #19808. Change-Id: I070f852531c92b3670bd76523326c9132bfc9416 Reviewed-on: https://go-review.googlesource.com/39152 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
* go/types: use std "DO NOT EDIT" comment for generated hilbert testRobert Griesemer2017-04-011-2/+1
| | | | | | | | | | For #13560. Change-Id: I884e63f89d0756ca87b8c2092b4fd8360f791a2f Reviewed-on: https://go-review.googlesource.com/39171 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
* go/build: remove unused returnImports parameterDaniel Martí2017-03-211-6/+6
| | | | | | | | | | | | | The code uses the filename suffix instead of the bool parameter to determine what to do. Fixes #19474. Change-Id: Ic552a54e50194592a4b4ae7f74d3109af54e6d36 Reviewed-on: https://go-review.googlesource.com/38265 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
* cmd/compile/internal/gc: export interface embedding informationMatthew Dempsky2017-03-212-5/+6
| | | | | | | | | | Fixes #16369. Change-Id: I23f8c36370d0da37ac5b5126d012d22f78782782 Reviewed-on: https://go-review.googlesource.com/38392 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
* Revert "go/types: enforce Check path restrictions via panics"Brad Fitzpatrick2017-03-171-3/+0
| | | | | | | | | | This reverts commit b744a11a966ad3999c190fea9909ec8df0570b87. Reason for revert: Broke trybots. (misc-vetall builder is busted) Change-Id: I651d1c18db2fb3cb6ec12c2ae62024627baf8d77 Reviewed-on: https://go-review.googlesource.com/38332 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* go/types: enforce Check path restrictions via panicsDaniel Martí2017-03-171-0/+3
| | | | | | | | | | Its godoc says that path must not be empty or dot, while the existing implementation happily accepts both. Change-Id: I64766271c35152dc7adb21ff60eb05c52237e6b6 Reviewed-on: https://go-review.googlesource.com/38262 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org>
* go/types: better error for assignment count mismatchesRobert Griesemer2017-03-175-24/+24
| | | | | | | | | | This matches the error message of cmd/compile (for assignments). Change-Id: I42a428f5d72f034e7b7e97b090a929e317e812af Reviewed-on: https://go-review.googlesource.com/38315 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
* cmd/vet: eliminate "might be too small for shift" warningsAliaksandr Valialkin2017-03-111-1/+5
| | | | | | | | | | | | Determine int, uint and uintptr bit sizes from GOARCH environment variable if it is set. Otherwise use host-specific sizes. Fixes #19321 Change-Id: I494b8e4b49b59d32794f50ff2ce06ba040cb8460 Reviewed-on: https://go-review.googlesource.com/37950 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>