Skip to content

Commit 22ded4d

Browse files
authored
Fix “deprecated” comments. (#4423)
A “deprecated” comment must be a separate paragraph, and there must be at least one other paragraph in the docstring. Otherwise pkg.go.dev won’t mark the symbol as deprecated. **What type of PR is this?** Documentation **What does this PR do? Why is it needed?** Correctly marks the deprecated symbols as deprecated on pkg.go.dev. **Which issues(s) does this PR fix?** Fixes # **Other notes for review**
1 parent 0154403 commit 22ded4d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

go/tools/bazel/bazel.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ import (
2424
"os"
2525
)
2626

27+
// The name of the environment variable to access test data files.
28+
//
2729
// Deprecated: Use github.com/bazelbuild/rules_go/go/runfiles instead to access
2830
// runfiles.
2931
const TEST_SRCDIR = "TEST_SRCDIR"
32+
3033
const TEST_TMPDIR = "TEST_TMPDIR"
34+
35+
// The name of the environment variable to access the test workspace name.
36+
//
3137
// Deprecated: Use github.com/bazelbuild/rules_go/go/runfiles instead to access
3238
// runfiles. With Bzlmod enabled, the corresponding environment variable has the
3339
// constant value "_main".
@@ -52,6 +58,7 @@ func TestTmpDir() string {
5258
// "-begin_files" and "-end_files" are used). Entries between these delimiters
5359
// are spliced out of from os.Args and returned to the caller. If the ordering
5460
// of -begin_files or -end_files is malformed, error is returned.
61+
//
5562
// Deprecated: This method is meant for internal use by bazel_testing only.
5663
func SpliceDelimitedOSArgs(begin, end string) ([]string, error) {
5764
var files []string

go/tools/bazel/runfiles.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ func ListRunfiles() ([]RunfileEntry, error) {
237237
// TestWorkspace returns the name of the Bazel workspace for this test.
238238
// TestWorkspace returns an error if the TEST_WORKSPACE environment variable
239239
// was not set or SetDefaultTestWorkspace was not called.
240+
//
240241
// Deprecated: With Bzlmod enabled, the workspace name is always "_main". Use
241242
// github.com/bazelbuild/rules_go/go/runfiles instead to access runfiles.
242243
func TestWorkspace() (string, error) {
@@ -252,6 +253,7 @@ func TestWorkspace() (string, error) {
252253
// SetDefaultTestWorkspace allows you to set a fake value for the
253254
// environment variable TEST_WORKSPACE if it is not defined. This is useful
254255
// when running tests on the command line and not through Bazel.
256+
//
255257
// Deprecated: With Bzlmod enabled, the workspace name is always "_main". Use
256258
// github.com/bazelbuild/rules_go/go/runfiles instead to access runfiles.
257259
func SetDefaultTestWorkspace(w string) {
@@ -263,6 +265,7 @@ func SetDefaultTestWorkspace(w string) {
263265
// It will return an error if there is no runfiles tree, for example because
264266
// the executable is run on Windows or was not invoked with 'bazel test'
265267
// or 'bazel run'.
268+
//
266269
// Deprecated: Use github.com/bazelbuild/rules_go/go/runfiles instead to access
267270
// runfiles, which provides a platform-agnostic fs.FS implementation.
268271
func RunfilesPath() (string, error) {

0 commit comments

Comments
 (0)