aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-08-16 11:18:02 -0400
committerGopher Robot <gobot@golang.org>2023-08-17 20:58:04 +0000
commit14e3c7338d9914295a25ba6b741063083b6b54db (patch)
tree55bf1720474dd03ae2c7aab269dd52a172fdd916
parent095cfba86be8db249ada8605fa31764fd4ce9241 (diff)
downloadgo-14e3c7338d9914295a25ba6b741063083b6b54db.tar.gz
go-14e3c7338d9914295a25ba6b741063083b6b54db.zip
[release-branch.go1.20] cmd/api: rename api.go to main_test.go
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. Fixes #62070. 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> Reviewed-on: https://go-review.googlesource.com/c/go/+/520060 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
-rw-r--r--src/cmd/api/api_test.go2
-rw-r--r--src/cmd/api/boring_test.go2
-rw-r--r--src/cmd/api/main_test.go (renamed from src/cmd/api/api.go)5
3 files changed, 5 insertions, 4 deletions
diff --git a/src/cmd/api/api_test.go b/src/cmd/api/api_test.go
index 5f9aa6d297..dbd31d8242 100644
--- a/src/cmd/api/api_test.go
+++ b/src/cmd/api/api_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package api
+package main
import (
"flag"
diff --git a/src/cmd/api/boring_test.go b/src/cmd/api/boring_test.go
index a9ec6e6bfe..f0e3575637 100644
--- a/src/cmd/api/boring_test.go
+++ b/src/cmd/api/boring_test.go
@@ -4,7 +4,7 @@
//go:build boringcrypto
-package api
+package main
import (
"fmt"
diff --git a/src/cmd/api/api.go b/src/cmd/api/main_test.go
index 399da1c0de..407e314e51 100644
--- a/src/cmd/api/api.go
+++ b/src/cmd/api/main_test.go
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package api computes the exported API of a set of Go packages.
+// This package computes the exported API of a set of Go packages.
// It is only a test, not a command, nor a usefully importable package.
-package api
+
+package main
import (
"bufio"