aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api
AgeCommit message (Collapse)Author
2021-12-13all: gofmt -w -r 'interface{} -> any' srcRuss Cox
And then revert the bootstrap cmd directories and certain testdata. And adjust tests as needed. Not reverting the changes in std that are bootstrapped, because some of those changes would appear in API docs, and we want to use any consistently. Instead, rewrite 'any' to 'interface{}' in cmd/dist for those directories when preparing the bootstrap copy. A few files changed as a result of running gofmt -w not because of interface{} -> any but because they hadn't been updated for the new //go:build lines. Fixes #49884. Change-Id: Ie8045cba995f65bd79c694ec77a1b3d1fe01bb09 Reviewed-on: https://go-review.googlesource.com/c/go/+/368254 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-08cmd/api: run half as many go list calls in parallelHeschi Kreinick
We currently run one 'go list' invocation per GOMAXPROC. Since the go command uses memory and has its own internal parallelism, that's unlikely to be an efficient use of resources. Run half as many. I suspect that's still too many but this should fix our OOMs. For #49957. Change-Id: Id06b6e0f0d96387a2a050e400f38bde6ba71aa60 Reviewed-on: https://go-review.googlesource.com/c/go/+/370376 Trust: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2021-10-28all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor)Russ Cox
When these packages are released as part of Go 1.18, Go 1.16 will no longer be supported, so we can remove the +build tags in these files. Ran go fix -fix=buildtag std cmd and then reverted the bootstrapDirs as defined in src/cmd/dist/buildtool.go, which need to continue to build with Go 1.4 for now. Also reverted src/vendor and src/cmd/vendor, which will need to be updated in their own repos first. Manual changes in runtime/pprof/mprof_test.go to adjust line numbers. For #41184. Change-Id: Ic0f93f7091295b6abc76ed5cd6e6746e1280861e Reviewed-on: https://go-review.googlesource.com/c/go/+/344955 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-10-12cmd/api: use placeholder names for type parametersRobert Findley
Changing type parameter names is not a breaking API change, so we should not include these names in the output of cmd/api. Instead print a placeholder '$<index>' wherever type parameters are referenced. This is valid for cmd/api as there is at most one type parameter list in scope for any exported declaration. If we ever support method type parameters, we'll need to revisit this syntax. Change-Id: I7e677b1dab6ffeb0b79afefdb8d2580bef93891c Reviewed-on: https://go-review.googlesource.com/c/go/+/355389 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
2021-10-12cmd/api: support type parametersIan Lance Taylor
Fixes #48706 Change-Id: If0f8d0b49300027e3b2b46f6870302acf2e00f4e Reviewed-on: https://go-review.googlesource.com/c/go/+/354612 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
2021-10-04cmd/api: set architecture sizes when type checkingMichael Pratt
Otherwise the type checker defaults to amd64, which can break type-checking for definitions using unsafe.Sizeof. This has the side effect of changing the API output: constants with different values across architectures (e.g., MaxInt) are now individually listed per-arch. This actually makes the API file more accurate, but does introduce a one-time discontinuity. These changes have been integrated into the API files where the constants were added. Change-Id: I4bbb0b7a7f405d3adda2d83869475c8bacdeb6a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/353331 Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2021-05-03cmd/api: disallow silent API additions after api/go1.n.txt is createdDmitri Shuralyov
At this time, the golang.org/s/release process arranges such that the api/go1.n.txt file is created when a Go 1.N Beta 1 release is being cut. The API check is currently configured so that tests don't fail visibly even if api/go1.n.txt becomes a subset of the actual API additions in the upcoming Go 1.N release as long as 'go version' has "devel" in it. The first time that 'go version' output drops the "devel" substring during testing is after the release-branch.go1.N branch is created as part of the process to cut a Go 1.N Release Candidate 1 release. The month or so between Beta 1 and RC 1 is well into the freeze and deliberate API changes are rare and very intentional. There seems to be agreement that it's healthy to make the API check stricter during that time period. Doing so will ensure that api/go1.n.txt cannot get stale after creation without anyone noticing, and may catch CLs that don't have the intended diff on the API. This CL changes behavior to be simple and clear: from the moment an api/go1.n.txt file corresponding to the current Go version in development is added to the tree, silent API additions stop being permitted. This CL also moves the magical "override the value of -allow_new flag if runtime.Version() contains 'devel' string" behavior from cmd/api command to the run.go script that calls it, making the CLI of cmd/api itself less surprising. Fixes #43956. Change-Id: I89468207573f7ccdbc9f12625dcdd3ef2bcf8f10 Reviewed-on: https://go-review.googlesource.com/c/go/+/315350 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2021-02-20all: go fmt std cmd (but revert vendor)Russ Cox
Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-01-21all: introduce and use internal/execabsRoland Shoemaker
Introduces a wrapper around os/exec, internal/execabs, for use in all commands. This wrapper prevents exec.LookPath and exec.Command from running executables in the current directory. All imports of os/exec in non-test files in cmd/ are replaced with imports of internal/execabs. This issue was reported by RyotaK. Fixes CVE-2021-3115 Fixes #43783 Change-Id: I0423451a6e27ec1e1d6f3fe929ab1ef69145c08f Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955304 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Katie Hockman <katiehockman@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/284783 Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Trust: Roland Shoemaker <roland@golang.org>
2020-12-09all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTempRuss Cox
As part of #42026, these helpers from io/ioutil were moved to os. (ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.) Update the Go tree to use the preferred names. As usual, code compiled with the Go 1.4 bootstrap toolchain and code vendored from other sources is excluded. ReadDir changes are in a separate CL, because they are not a simple search and replace. For #42026. Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/266365 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-20io/fs: move FileInfo, FileMode, PathError, ErrInvalid, ... from os to io/fsRuss Cox
First step of creating the new io/fs package. For #41190. Change-Id: I1339b1abdd533b0f1deab283628088b2f706fb5b Reviewed-on: https://go-review.googlesource.com/c/go/+/243906 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-09-14cmd/api: omit outside dependencies when listing the packages in "std"Bryan C. Mills
As of CL 251159, when 'go list -deps std' is run within GOROOT/src, it treats the vendored external dependencies as real module dependencies, not standard-library "vendor/" packages (which still exist in that case, but are treated as distinct packages outside the "std" module). Fixes #41358 Updates #30241 Change-Id: Ic23eae9829d90e74a340d49ca9052e9191597410 Reviewed-on: https://go-review.googlesource.com/c/go/+/254738 Run-TryBot: Bryan C. Mills <bcmills@google.com> Trust: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-04-20cmd/api: limit concurrent 'go list' calls to GOMAXPROCSBryan C. Mills
Each invocation of 'go list' may consume a significant quantity of system resources, including buffers for reading files and RAM for the runtime's memory footprint. Very small builders may even hit swap as a result of that load, further exacerbating resource contention. To avoid overloading small builders, restrict 'go list' calls to runtime.GOMAXPROCS as it is set at the first call to loadImports. This also somewhat improves running time even on larger machines: on my workstation, this change reduces the wall time for 'go test cmd/api' by around 100ms. Updates #38537 Change-Id: I968e0f961a8f1d84c27e1ab8b621b9670dcfd448 Reviewed-on: https://go-review.googlesource.com/c/go/+/228998 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2020-04-04cmd/dist: remove darwin/386, darwin/arm as valid portsBrad Fitzpatrick
This only removes the ability to build it, and removes it as a src/buildall.bash target (which uses go tool dist list). Now: $ go tool dist list | grep ^darwin darwin/amd64 darwin/arm64 After this, remaining is removing leftover port--specific code in the tree. Updates #37610 Updates #37611 Change-Id: I00f03b2355c2e152f75e57abd3063be243529d2d Reviewed-on: https://go-review.googlesource.com/c/go/+/226985 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
2020-03-25cmd/api: make NewWatcher populate its own package and import metadataBryan C. Mills
This partially undoes the optimizations of CL 177597, but makes up some of the difference by caching the package list and import metadata and making the initial calls concurrently, including in TestMain. That reduces the critical path from two sequential 'go list' invocations to just one (run many times concurrently), and eliminates the need for assumptions about the consistency of the 'std' dependency graph across platforms (and hard-coded special cases for packages that violate those assumptions). In the process, this simplifies and fixes TestBenchmark (which has been silently broken since CL 164623). This increases 'time go tool dist test api' on my workstation from 0m8.4s / 0m13.8s / 0m1.7s to 0m10.5s / 0m23.1s / 0m5.1s, compared to 0m12.4s / 0m23.2s / 0m4.7s before CL 177597. (That is, this change retains about half of the wall-time speedup, but almost none of the user-time speedup.) Tested manually using 'go test -race -bench=. cmd/api'. Fixes #37951 Change-Id: Icd537e035e725e1ee7c41d97da5c6651233b927e Reviewed-on: https://go-review.googlesource.com/c/go/+/224619 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2019-05-21cmd/api: read std package info once, not per goos-goarch-cgoRuss Cox
Cuts api test time from 12.7r 26.2u 14.2s to 7.5r 12.1u 2.2s. After this change, all.bash runs in ~4:36 on my laptop. For #26473. Change-Id: I4211e6afcd7ab61a4ed2c9a2aa5ac1ea04982695 Reviewed-on: https://go-review.googlesource.com/c/go/+/177597 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-04-20all: add start of netbsd/arm64 supportMaya Rashish
This works well enough to run some code natively on arm64, but not well enough for more complicated code. I've been suggested to start a pull request anyway. Updates #30824 Change-Id: Ib4f63e0e8a9edfc862cf65b5f1b0fbf9a8a1628e GitHub-Last-Rev: b01b105e0446e349c8d9895d3ac6918fa0cdc48c GitHub-Pull-Request: golang/go#29398 Reviewed-on: https://go-review.googlesource.com/c/go/+/155739 Run-TryBot: Benny Siegert <bsiegert@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2019-04-16all: clean up code with token.IsExportedDaniel Martí
A handful of packages were reimplementing IsExported, so use token.IsExported instead. This caused the deps test to fail for net/rpc. However, net/rpc deals with Go types, and go/token is light and fairly low-level in terms of Go tooling packages, so that's okay. While at it, replace all uses of ast.IsExported with token.IsExported. This is more consistent, and also means that the import graphs are leaner. A couple of files no longer need to import go/ast, for example. We can't get rid of cmd/compile/internal/types.IsExported, as the compiler can only depend on go/token as of Go 1.4. However, gc used different implementations in a couple of places, so consolidate the use of types.IsExported there. Finally, we can't get rid of the copied IsExported implementation in encoding/gob, as go/token depends on it as part of a test. That test can't be an external test either, so there's no easy way to break the import cycle. Overall, this removes about forty lines of unnecessary code. Change-Id: I86a475b7614261e6a7b0b153d5ca02b9f64a7b2d Reviewed-on: https://go-review.googlesource.com/c/go/+/172037 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-08cmd/api: use 'go list' to locate transitive dependencies of stdBryan C. Mills
With standard-library modules and vendoring, the mapping from import path to directory within the standard library is no longer entirely trivial. Fortunately, 'go list' makes that mapping straightforward to compute. Updates #30241 Updates #30228 Change-Id: Iddd77c21a527b7acdb30c17bec8b4bbd43e23756 Reviewed-on: https://go-review.googlesource.com/c/go/+/165497 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-03-04cmd/api: fix no go files package panicBaokun Lee
Fixes #29837 Change-Id: I7d57c24d2133932c076df6f41dd6589f777b65dd Reviewed-on: https://go-review.googlesource.com/c/158877 Run-TryBot: Baokun Lee <nototon@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-29vendor/golang_org/x: move to internal/xBryan C. Mills
Packages in vendor/ directories have a "vendor/" path prefix in GOPATH mode, but intentionally do not in module mode. Since the import path is embedded in the compiled output, changing that path invalidates cache entries and causes cmd/go to try to rebuild (and reinstall) the vendored libraries, which will fail if the directory containing those libraries is read-only. If I understood correctly, this is the approach Russ suggested as an alternative to https://golang.org/cl/136138. Fixes #27285 Fixes #26988 Change-Id: I8a2507fa892b84cde0a803aaa79e460723da572b Reviewed-on: https://go-review.googlesource.com/c/147443 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2018-10-05cmd/api: explicit tagKey with GOOS and GOARCHMeng Zhuo
The origin tagKey is just dirname if no tags input which will cause pkgCache missmatch if other imported pkg explicit on GOARCH or GOOS This CL will add GOOS and GOARCH to tagKey Fixes #8425 Fixes #21181 Change-Id: Ifc189cf6746d753ad7c7e5bb60621297fc0a4e35 Reviewed-on: https://go-review.googlesource.com/c/138315 Reviewed-by: Robert Griesemer <gri@golang.org>
2017-12-11cmd/api: don’t rely on hardcoded go versionsAndrew Bonventre
Instead of requiring that cmd/api/run.go be edited upon each release to include the next Go version number, look in $GOROOT/api for files with the prefix go1* and use those instead to perform API checks. Change-Id: I5d9407f2bd368ff5e62f487cccdd245641ca9c9b Reviewed-on: https://go-review.googlesource.com/83355 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-07api: promote next to go1.10Andrew Bonventre
Change-Id: I2a4347540ecb94a9f124a228dc31452620ab0645 Reviewed-on: https://go-review.googlesource.com/82335 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-10-05all: revert "all: prefer strings.IndexByte over strings.Index"Marvin Stenger
This reverts https://golang.org/cl/65930. Fixes #22148 Change-Id: Ie0712621ed89c43bef94417fc32de9af77607760 Reviewed-on: https://go-review.googlesource.com/68430 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-25all: prefer strings.IndexByte over strings.IndexMarvin Stenger
strings.IndexByte was introduced in go1.2 and it can be used effectively wherever the second argument to strings.Index is exactly one byte long. This avoids generating unnecessary string symbols and saves a few calls to strings.Index. Change-Id: I1ab5edb7c4ee9058084cfa57cbcc267c2597e793 Reviewed-on: https://go-review.googlesource.com/65930 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-20all: correct location of go toolHiroshi Ioka
In general, there are no guarantee that `go` command exist on $PATH. This CL tries to get `go` command from $GOROOT/bin instead. There are three kinds of code we should handle: For normal code, the CL implements goCmd() or goCmdName(). For unit tests, the CL uses testenv.GoTool() or testenv.GoToolPath(). For integration tests, the CL sets PATH=$GOROOT/bin:$PATH in cmd/dist. Note that make.bash sets PATH=$GOROOT/bin:$PATH in the build process. So this change is only useful when we use toolchain manually. Updates #21875 Change-Id: I963b9f22ea732dd735363ececde4cf94a5db5ca2 Reviewed-on: https://go-review.googlesource.com/64650 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-06-14api: promote next to go1.9Chris Broadfoot
Change-Id: I27aa87607aa82b400411a60c6bdb6f9a42ff97c1 Reviewed-on: https://go-review.googlesource.com/45776 Run-TryBot: Chris Broadfoot <cbro@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-12-01api: promote next.txt to go1.8.txt, update go toolgo1.8beta1Chris Broadfoot
Change-Id: I37f2893ce14009efe095aac3bc811d650c66bf2a Reviewed-on: https://go-review.googlesource.com/33761 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-13all: rename vendored golang.org/x/net packages to golang_orgBrad Fitzpatrick
Regression from Go 1.6 to Go 1.7rc1: we had broken the ability for users to vendor "golang.org/x/net/http2" or "golang.org/x/net/route" because we were vendoring them ourselves and cmd/go and cmd/compile do not understand multiple vendor directories across multiple GOPATH workspaces (e.g. user's $GOPATH and default $GOROOT). As a short-term fix, since fixing cmd/go and cmd/compile is too invasive at this point in the cycle, just rename "golang.org" to "golang_org" for the standard library's vendored copy. Fixes #16333 Change-Id: I9bfaed91e9f7d4ca6bab07befe80d71d437a21af Reviewed-on: https://go-review.googlesource.com/24902 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-06-02api: promote next.txt to go1.7.txt and update api toolgo1.7beta1Andrew Gerrand
Change-Id: Idb348be00f949da553aa6aab62836f59dfee298d Reviewed-on: https://go-review.googlesource.com/23671 Reviewed-by: Chris Broadfoot <cbro@golang.org> Run-TryBot: Andrew Gerrand <adg@golang.org>
2016-04-22cmd/api: ignore vendored packagesBrad Fitzpatrick
Fixes #15404 Change-Id: I16f2a34a1e4c3457053a1fc2141f21747cfb22b4 Reviewed-on: https://go-review.googlesource.com/22386 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2016-03-25all: delete dead non-test codeDominik Honnef
This change removes a lot of dead code. Some of the code has never been used, not even when it was first commited. The rest shouldn't have survived refactors. This change doesn't remove unused routines helpful for debugging, nor does it remove code that's used in commented out blocks of code that are only unused temporarily. Furthermore, unused constants weren't removed when they were part of a set of constants from specifications. One noteworthy omission from this CL are about 1000 lines of unused code in cmd/fix, 700 lines of which are the typechecker, which hasn't been used ever since the pre-Go 1 fixes have been removed. I wasn't sure if this code should stick around for future uses of cmd/fix or be culled as well. Change-Id: Ib714bc7e487edc11ad23ba1c3222d1fd02e4a549 Reviewed-on: https://go-review.googlesource.com/20926 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-01all: make copyright headers consistent with one space after periodBrad Fitzpatrick
This is a subset of https://golang.org/cl/20022 with only the copyright header lines, so the next CL will be smaller and more reviewable. Go policy has been single space after periods in comments for some time. The copyright header template at: https://golang.org/doc/contribute.html#copyright also uses a single space. Make them all consistent. Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0 Reviewed-on: https://go-review.googlesource.com/20111 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-20cmd/api: fix benchmark to ignore internal packagesIan Lance Taylor
Change-Id: I8ee46287ae0744efa83ad343997ad6835520fa5c Reviewed-on: https://go-review.googlesource.com/19688 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-17api: create go1.6.txtgo1.6beta1Brad Fitzpatrick
Change-Id: If2b30ab412d6799c8be01eb007462d6b58660ece Reviewed-on: https://go-review.googlesource.com/18014 Reviewed-by: Chris Broadfoot <cbro@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-12-14go/constant: switch to floating-point representation when fractions become ↵Robert Griesemer
too large Use two internal representations for Float values (similar to what is done for Int values). Transparently switch to a big.Float representation when big.Rat values become unwieldy. This is almost never needed for real-world programs but it is trivial to create test cases that cannot be handled with rational arithmetic alone. As a consequence, the go/constant API semantics changes slightly: Until now, a value could always be represented in its "smallest" form (e.g., float values that happened to be integers would be represented as integers). Now, constant Kind depends on how the value was created, rather than its actual value. (The reason why we cannot automatically "normalize" values to their smallest form anymore is because floating-point numbers are not exact in general; and thus normalization is often not possible in the first place, or would throw away precision when it is not desired.) This has repercussions as to how constant Values are used go/types and required corresponding adjustments. Details of the changes: go/constant package: - use big.Rat and big.Float values to represent floating-point values (internal change) - changed semantic of Value.Kind accordingly - String now returns a short, human-readable form of a value (this leads to better error messages in go/types) - added ToInt, ToFloat, and ToComplex conversion functions - added ExactString to obtain an exact string form of a value go/types: - adjusted and simplified implementation of representableConst - adjusted various places where Value.Kind was expected to be "smallest" by calling the respective ToInt/Float/Complex conversion functions - enabled 5 disabled tests in stdlib_test.go that now work api checker: - print all constant values in a short human-readable form (floats are printed in floating-point form), but also print an exact form if it is different from the short form - adjusted test golden file and go.1.1.text reference file Fixes #11327. Change-Id: I492b704aae5b0238e5b7cee13e18ffce61193587 Reviewed-on: https://go-review.googlesource.com/17360 Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-14net/http: enable automatic HTTP/2 if TLSNextProto is nilBrad Fitzpatrick
This enables HTTP/2 by default (for https only) if the user didn't configure anything in their NPN/ALPN map. If they're using SPDY or an alternate http2 or a newer http2 from x/net/http2, we do nothing and don't use the standard library's vendored copy of x/net/http2. Upstream remains golang.org/x/net/http2. Update #6891 Change-Id: I69a8957a021a00ac353f9d7fdb9a40a5b69f2199 Reviewed-on: https://go-review.googlesource.com/15828 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-21api: add go1.5.txt API file, reset next.txtBrad Fitzpatrick
Fixes #11752 Change-Id: If4196b4bbba4f1485608bfafa98fa54781177273 Reviewed-on: https://go-review.googlesource.com/12325 Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-11all: link to https instead of httpBrad Fitzpatrick
The one in misc/makerelease/makerelease.go is particularly bad and probably warrants rotating our keys. I didn't update old weekly notes, and reverted some changes involving test code for now, since we're late in the Go 1.5 freeze. Otherwise, the rest are all auto-generated changes, and all manually reviewed. Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d Reviewed-on: https://go-review.googlesource.com/12048 Reviewed-by: Rob Pike <r@golang.org>
2015-04-15go/importer: added go/importer package, adjusted go/typesRobert Griesemer
- The go/importer package provides access to compiler-specific importers. - Adjusted go/internal/gcimporter and go/types as needed. - types.Check was removed - not much simpler than calling types.Config.Check. - Package "unsafe" is now handled by the type checker; importers are not called for it anymore. - In std lib tests, re-use importer for faster testing (no need to re-import previously imported packages). - Minor cleanups. The code still needs cleanups before submitting. Change-Id: Idd456da2e9641688fe056504367348926feb0755 Reviewed-on: https://go-review.googlesource.com/8767 Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Griesemer <gri@golang.org>
2015-04-08cmd/api: make the test more robustShenghou Ma
Previously, the TestCompareAPI test would fail if runtime.Version() is "dev", or, more importantly, "go1.5"; because compareAPI depends on runtime.Version and -allow_new flag. Move that logic out make its test more robust. Change-Id: I8f40daa1838b8acd26adac8848762d95315053b0 Reviewed-on: https://go-review.googlesource.com/8622 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-08cmd/api: re-enable TestGolden on naclShenghou Ma
Fixes #10369. Change-Id: If0a6d2b33c6862c9f7f862bdc997f2204072c6dc Reviewed-on: https://go-review.googlesource.com/8620 Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-08cmd/api: update api checker to use go/types from std repoRobert Griesemer
The old code checked out a specific version of go/types from the x/tools repo. With go/types being part of the std repo, this is not necessary anymore. Also, for the same reason, the api tool is now built like any other regular command. There's no need to build it for each run. Removed the respective +build tags. Change-Id: I5088e4867223d676957084c24651ec05452ac495 Reviewed-on: https://go-review.googlesource.com/8564 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-02-08Revert "cmd/api: treat a hex-y VERSION as devel and permit API changes"David Symonds
This reverts commit 11d1c05. See #9296 for details. Change-Id: I89a36351cb007836662f28a611af5616818b95fe Reviewed-on: https://go-review.googlesource.com/1536 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-23cmd/api: work around Windows rename issue on the buildersBrad Fitzpatrick
More cmd/api/run.go hell. Fixes #9407 Change-Id: If8fb446a2471d6372beb0534c9ab6824029b404c Reviewed-on: https://go-review.googlesource.com/2054 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Minux Ma <minux@golang.org>
2014-12-22cmd/api: fix race in run.go with multiple builders on a machineBrad Fitzpatrick
Fixes #9407 Change-Id: I765e8009c7ee22473ac8c2d81c7f6c8ec9866c51 Reviewed-on: https://go-review.googlesource.com/1980 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2014-12-12cmd/api: treat a hex-y VERSION as devel and permit API changesBrad Fitzpatrick
Change-Id: I2b05b7ff217586851ab41744e3077fddc480253c Reviewed-on: https://go-review.googlesource.com/1405 Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-12cmd/api: update the API checker to Go 1.4 and gitBrad Fitzpatrick
Still using the ancient go/types API. Updating that to the modern API should be a separate effort in a separate change. Change-Id: Ic1c5ae3c13711d34fe757507ecfc00ee883810bf Reviewed-on: https://go-review.googlesource.com/1404 Reviewed-by: David Symonds <dsymonds@golang.org>
2014-12-12[release-branch.go1.4] cmd/api: make API check fail for undeclared API in ↵Russ Cox
release branch We forgot to do the usual API review. Make that not possible in the future. I'll pull this change over to the main branch too, but it's more important (and only testable) here. LGTM=bradfitz R=bradfitz CC=golang-codereviews https://golang.org/cl/185050043