Skip to content

Commit 3483a5e

Browse files
xieyuschengopherbot
authored andcommitted
go/packages: use link notation in comments for godoc rendering
fixes golang/go#69618 Change-Id: I7585b7cf92472b4ff1944ad3486cd930475143d1 Reviewed-on: https://go-review.googlesource.com/c/tools/+/615695 Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
1 parent 75350b9 commit 3483a5e

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

go/packages/doc.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@ graph using the Imports fields.
6464
6565
The Load function can be configured by passing a pointer to a Config as
6666
the first argument. A nil Config is equivalent to the zero Config, which
67-
causes Load to run in LoadFiles mode, collecting minimal information.
67+
causes Load to run in [LoadFiles] mode, collecting minimal information.
6868
See the documentation for type Config for details.
6969
7070
As noted earlier, the Config.Mode controls the amount of detail
7171
reported about the loaded packages. See the documentation for type LoadMode
7272
for details.
7373
7474
Most tools should pass their command-line arguments (after any flags)
75-
uninterpreted to [Load], so that it can interpret them
75+
uninterpreted to Load, so that it can interpret them
7676
according to the conventions of the underlying build system.
7777
7878
See the Example function for typical usage.
7979
8080
# The driver protocol
8181
82-
[Load] may be used to load Go packages even in Go projects that use
82+
Load may be used to load Go packages even in Go projects that use
8383
alternative build systems, by installing an appropriate "driver"
8484
program for the build system and specifying its location in the
8585
GOPACKAGESDRIVER environment variable.

go/packages/packages.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ import (
4646
//
4747
// Unfortunately there are a number of open bugs related to
4848
// interactions among the LoadMode bits:
49-
// - https://github.com/golang/go/issues/56633
50-
// - https://github.com/golang/go/issues/56677
51-
// - https://github.com/golang/go/issues/58726
52-
// - https://github.com/golang/go/issues/63517
49+
// - https://github.com/golang/go/issues/56633
50+
// - https://github.com/golang/go/issues/56677
51+
// - https://github.com/golang/go/issues/58726
52+
// - https://github.com/golang/go/issues/63517
5353
type LoadMode int
5454

5555
const (
@@ -248,14 +248,13 @@ type Config struct {
248248

249249
// Load loads and returns the Go packages named by the given patterns.
250250
//
251-
// Config specifies loading options;
252-
// nil behaves the same as an empty Config.
251+
// The cfg parameter specifies loading options; nil behaves the same as an empty [Config].
253252
//
254253
// The [Config.Mode] field is a set of bits that determine what kinds
255254
// of information should be computed and returned. Modes that require
256255
// more information tend to be slower. See [LoadMode] for details
257256
// and important caveats. Its zero value is equivalent to
258-
// NeedName | NeedFiles | NeedCompiledGoFiles.
257+
// [NeedName] | [NeedFiles] | [NeedCompiledGoFiles].
259258
//
260259
// Each call to Load returns a new set of [Package] instances.
261260
// The Packages and their Imports form a directed acyclic graph.
@@ -272,7 +271,7 @@ type Config struct {
272271
// Errors associated with a particular package are recorded in the
273272
// corresponding Package's Errors list, and do not cause Load to
274273
// return an error. Clients may need to handle such errors before
275-
// proceeding with further analysis. The PrintErrors function is
274+
// proceeding with further analysis. The [PrintErrors] function is
276275
// provided for convenient display of all errors.
277276
func Load(cfg *Config, patterns ...string) ([]*Package, error) {
278277
ld := newLoader(cfg)

0 commit comments

Comments
 (0)