]> Cypherpunks repositories - gostls13.git/commitdiff
go/ast: more godoc links
authorOlivier Mengué <olivier.mengue@gmail.com>
Wed, 27 Mar 2024 22:09:23 +0000 (23:09 +0100)
committerGopher Robot <gobot@golang.org>
Thu, 28 Mar 2024 21:32:41 +0000 (21:32 +0000)
Change-Id: I1290ad66d3c758c3b89caf0a217cb3d5358c5dd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/574696
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/go/ast/ast.go
src/go/ast/print.go
src/go/ast/scope.go

index ef96cc4a6dfa238fd95593ba666e2e083ce0565a..73aa3da89eab6bb600d81f92452c62c9687892f5 100644 (file)
@@ -1032,9 +1032,12 @@ func (*FuncDecl) declNode() {}
 // positions). A [CommentMap] may be used to facilitate some of these operations.
 //
 // Whether and how a comment is associated with a node depends on the
-// interpretation of the syntax tree by the manipulating program: Except for Doc
+// interpretation of the syntax tree by the manipulating program: except for Doc
 // and [Comment] comments directly associated with nodes, the remaining comments
-// are "free-floating" (see also issues #18593, #20744).
+// are "free-floating" (see also issues [#18593], [#20744]).
+//
+// [#18593]: https://go.dev/issue/18593
+// [#20744]: https://go.dev/issue/20744
 type File struct {
        Doc     *CommentGroup // associated documentation; or nil
        Package token.Pos     // position of "package" keyword
@@ -1080,7 +1083,7 @@ func (p *Package) End() token.Pos { return token.NoPos }
 // not handwritten, by detecting the special comment described
 // at https://go.dev/s/generatedcode.
 //
-// The syntax tree must have been parsed with the ParseComments flag.
+// The syntax tree must have been parsed with the [parser.ParseComments] flag.
 // Example:
 //
 //     f, err := parser.ParseFile(fset, filename, src, parser.ParseComments|parser.PackageClauseOnly)
index d1aad50103a8a65cda251d6e7b3497dcd0e14a2f..ccef0577da0f7aeca97b58e42d41fee0437af224 100644 (file)
@@ -17,8 +17,8 @@ import (
 // A FieldFilter may be provided to [Fprint] to control the output.
 type FieldFilter func(name string, value reflect.Value) bool
 
-// NotNilFilter returns true for field values that are not nil;
-// it returns false otherwise.
+// NotNilFilter is a [FieldFilter] that returns true for field values
+// that are not nil; it returns false otherwise.
 func NotNilFilter(_ string, v reflect.Value) bool {
        switch v.Kind() {
        case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Pointer, reflect.Slice:
index 039ca58bc0920b6eef4844fe9deec624d5cf5bbe..9d97e24e298d741fc6a82c09982a615c3e052831 100644 (file)
@@ -144,10 +144,10 @@ func (obj *Object) Pos() token.Pos {
        return token.NoPos
 }
 
-// ObjKind describes what an object represents.
+// ObjKind describes what an [Object] represents.
 type ObjKind int
 
-// The list of possible Object kinds.
+// The list of possible [Object] kinds.
 const (
        Bad ObjKind = iota // for error handling
        Pkg                // package