aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/api/api.go
AgeCommit message (Collapse)Author
2023-08-16cmd/api: rename api.go to main_test.goRuss Cox
This makes cmd/api no longer an importable package. In CL 453258 I forgot that there was no direct prohibition on importing packages from cmd - we just rely on the fact that cmd/* is all package main and everything else is cmd/internal. Fixes #62069. Change-Id: Ifed738d333b40663f85eca8f83025fcea5df89a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/520038 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-06-02cmd/api: make check even pickier about api/next/*.txtDmitri Shuralyov
As spotted in CL 499981, 3 out of 51 of the api/next/*.txt files ended up with a blank line at the end. It's possible it would've been more if human reviewers didn't catch them. Since there's no formatter for these files, the only way to help catch things is to make the check pickier (as done in CL 431335). It can be loosened to let in useful blank lines if needed in the future. Change-Id: Iae7ee8e782b32707c576150914539ac4cc0faec4 Reviewed-on: https://go-review.googlesource.com/c/go/+/500115 Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-04-27cmd/api: remove unused functionalityDmitri Shuralyov
We no longer use the optional parameter to compareAPI. We now always set allowAdd to false. (Except in tests, making them less useful than they could be.) Flags and parsing their value are no more. Remove all the unused functionality and update test cases so they're closer to what the API checker does when it runs for real. Order the features, required, exception variables and fields more consistently. For #43956. Change-Id: Iaa4656a89a3fca3129742165a448d385e55e4a98 Reviewed-on: https://go-review.googlesource.com/c/go/+/489436 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-04-27cmd/api: make api/next/* entries required, not optionalDmitri Shuralyov
We want the API check to catch if some API present in api/next/* files is no longer implemented in the tree, and report it in the same CL that is making the change (by failing loudly). Arguably this should've been the case since CL 315350, but I didn't notice it at the time. Do it now. For #43956. Change-Id: I73330dd5fd3f5706a1fdf13b2bf8e0f24c6b48e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/488135 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
2023-02-17cmd/api: add API checks for freebsd/riscv64Dmitri Goutnik
The freebsd/riscv64 port was added in go1.20, make cmd/api aware of it and backfill API files. For #58582 Change-Id: I242b161cdb6221c8f60a1868c6435be26fca0078 Reviewed-on: https://go-review.googlesource.com/c/go/+/469135 Run-TryBot: Dmitri Goutnik <dgoutnik@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2023-02-17cmd/api: add API checks for freebsd/arm64Dmitri Goutnik
The freebsd/arm64 port was added in go1.14, make cmd/api aware of it and backfill API files. For #58582 Change-Id: I8b25c6cf5a66611d90d225762b257679a4abface Reviewed-on: https://go-review.googlesource.com/c/go/+/469115 Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Dmitri Goutnik <dgoutnik@gmail.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-12-02cmd/api: track darwin arm64 portRuss Cox
The darwin arm64 port was added in Go 1.16 and is a first-class port, so it should be tracked by cmd/api. This CL does that, backfilling API files as needed. It also removes a spurious cgo.Incomplete API feature. Change-Id: Idd995677915e81bf1c2e09be65b31e084b75f668 Reviewed-on: https://go-review.googlesource.com/c/go/+/453260 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-12-02cmd/api: track deprecationsRuss Cox
Deprecating an API creates notices that go out to potentially millions of Go developers encouraging them to update their code. The choice to deprecate an API is as important as the choice to add a new API. We should track those and make them explicit. This will also ensure that deprecations go through proposal review. Change-Id: Ide9f60c32e5a88fb133e0dfedd984b8b0f70f510 Reviewed-on: https://go-review.googlesource.com/c/go/+/453259 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-11-28cmd/api: rewrite as package testRuss Cox
No one ever runs 'go tool api', because the invocation has gotten unwieldy enough that it's not practical. And we don't support it as a standalone tool for other packages - it's not even in the distribution. Making it an ordinary package test lets us invoke it more easily from cmd/dist (as go test cmd/api -check) and avoids the increasingly baroque code in run.go to build a command line. Left in cmd/api even though it's no longer a command because (1) it uses a package from cmd/vendor and (2) it uses internal/testenv. Otherwise it could be misc/api. Fixes #56845. Change-Id: I00a13d9c19b1e259fa0e6bb93d1a4dca25f0e8c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/453258 Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Russ Cox <rsc@golang.org>