]> Cypherpunks repositories - gostls13.git/commitdiff
all: fix some comments
authorcui fliter <imcusg@gmail.com>
Tue, 24 Jan 2023 01:20:13 +0000 (09:20 +0800)
committerGopher Robot <gobot@golang.org>
Tue, 24 Jan 2023 18:55:49 +0000 (18:55 +0000)
Change-Id: I3e9f05d221990b1ae464545d6d8b2e22c35bca21
Reviewed-on: https://go-review.googlesource.com/c/go/+/463077
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

18 files changed:
src/cmd/compile/internal/typecheck/typecheck.go
src/cmd/compile/internal/types/type.go
src/cmd/compile/internal/types2/assignments.go
src/cmd/compile/internal/types2/conversions.go
src/cmd/compile/internal/types2/index.go
src/cmd/compile/internal/walk/builtin.go
src/cmd/dist/build.go
src/cmd/dist/buildgo.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/search/search.go
src/cmd/go/internal/vcs/vcs.go
src/cmd/go/internal/web/http.go
src/cmd/go/internal/work/exec.go
src/cmd/internal/archive/archive.go
src/go/types/conversions.go
src/go/types/index.go
src/syscall/timestruct.go

index 1857994b620ecc83d570784c4b4126e13986359d..57dc5a39ec413b3bc55f8e9667a0156299b86f57 100644 (file)
@@ -1469,7 +1469,7 @@ func sigrepr(t *types.Type, isddd bool) string {
        return t.String()
 }
 
-// sigerr returns the signature of the types at the call or return.
+// fmtSignature returns the signature of the types at the call or return.
 func fmtSignature(nl ir.Nodes, isddd bool) string {
        if len(nl) < 1 {
                return "()"
index 4bdbc3d931aca62d9705f77c1a6e435340c9cef2..d426c2cb8e1f1261e48c79b301b51405edd2cc9e 100644 (file)
@@ -579,7 +579,7 @@ func (f *Fields) Append(s ...*Field) {
        *f.s = append(*f.s, s...)
 }
 
-// New returns a new Type of the specified kind.
+// newType returns a new Type of the specified kind.
 func newType(et Kind) *Type {
        t := &Type{
                kind:  et,
index ca8c04e1e289c28e140a311ce003366d2788f820..35fb3f5b143a38184b825fd4e6d9ab89884d9fbe 100644 (file)
@@ -427,7 +427,7 @@ func (check *Checker) assignVars(lhs, orig_rhs []syntax.Expr) {
        }
 }
 
-// unpack unpacks a *syntax.ListExpr into a list of syntax.Expr.
+// unpackExpr unpacks a *syntax.ListExpr into a list of syntax.Expr.
 // Helper introduced for the go/types -> types2 port.
 // TODO(gri) Should find a more efficient solution that doesn't
 // require introduction of a new slice for simple
index a80857b20344baf565ccaed96b86680d0295e532..267324421ddab9721bde210ca222c39a79b48688 100644 (file)
@@ -12,7 +12,7 @@ import (
        "unicode"
 )
 
-// Conversion type-checks the conversion T(x).
+// conversion type-checks the conversion T(x).
 // The result is in x.
 func (check *Checker) conversion(x *operand, T Type) {
        constArg := x.mode == constant_
index 9e5c4d8afad9f68838d5451bbbdd417a62630fba..38134ec2cc3197788f55d236c779cadfe87bc5fe 100644 (file)
@@ -415,7 +415,7 @@ func (check *Checker) isValidIndex(x *operand, code Code, what string, allowNega
        return true
 }
 
-// indexElts checks the elements (elts) of an array or slice composite literal
+// indexedElts checks the elements (elts) of an array or slice composite literal
 // against the literal's element type (typ), and the element indices against
 // the literal length if known (length >= 0). It returns the length of the
 // literal (maximum index value + 1).
index 31c4b060d5064d12a54973483bbf5d57c05d3f8a..4c5ee9baecb1f1d230b4d4bc9cdc44d942243c74 100644 (file)
@@ -652,7 +652,7 @@ func walkPrint(nn *ir.CallExpr, init *ir.Nodes) ir.Node {
        return walkStmt(typecheck.Stmt(r))
 }
 
-// walkRecover walks an ORECOVERFP node.
+// walkRecoverFP walks an ORECOVERFP node.
 func walkRecoverFP(nn *ir.CallExpr, init *ir.Nodes) ir.Node {
        return mkcall("gorecover", nn.Type(), init, walkExpr(nn.Args[0], init))
 }
index 75daf7fdbeb4f15f2593c8b75ece1ae281cdb27f..4d118f1a643904b78a19fd03fefea54921fcd299 100644 (file)
@@ -1107,7 +1107,7 @@ func shouldbuild(file, pkg string) bool {
        return true
 }
 
-// copy copies the file src to dst, via memory (so only good for small files).
+// copyfile copies the file src to dst, via memory (so only good for small files).
 func copyfile(dst, src string, flag int) {
        if vflag > 1 {
                errprintf("cp %s %s\n", src, dst)
index 495244a3a19400e83842a0cc452542723ce93b95..7f1bc0105e061a2bd7b8749b3ef9e62c4bddb913 100644 (file)
@@ -91,7 +91,7 @@ func defaultCCFunc(name string, defaultcc map[string]string) string {
        return buf.String()
 }
 
-// mkzcgo writes zosarch.go for cmd/go.
+// mkzosarch writes zosarch.go for cmd/go.
 func mkzosarch(dir, file string) {
        // sort for deterministic zosarch.go file
        var list []string
index 56a4e5eaedd57577d649d424a0c71815940ef48d..7aee65667d91cb16472f6ae1a6fbaa5b31d3d814 100644 (file)
@@ -2662,19 +2662,19 @@ func (p *Package) InternalXGoFiles() []string {
        return p.mkAbs(p.XTestGoFiles)
 }
 
-// InternalGoFiles returns the list of all Go files possibly relevant for the package,
+// InternalAllGoFiles returns the list of all Go files possibly relevant for the package,
 // using absolute paths. "Possibly relevant" means that files are not excluded
 // due to build tags, but files with names beginning with . or _ are still excluded.
 func (p *Package) InternalAllGoFiles() []string {
        return p.mkAbs(str.StringList(p.IgnoredGoFiles, p.GoFiles, p.CgoFiles, p.TestGoFiles, p.XTestGoFiles))
 }
 
-// usesSwig reports whether the package needs to run SWIG.
+// UsesSwig reports whether the package needs to run SWIG.
 func (p *Package) UsesSwig() bool {
        return len(p.SwigFiles) > 0 || len(p.SwigCXXFiles) > 0
 }
 
-// usesCgo reports whether the package needs to run cgo
+// UsesCgo reports whether the package needs to run cgo
 func (p *Package) UsesCgo() bool {
        return len(p.CgoFiles) > 0
 }
@@ -3433,7 +3433,7 @@ func SelectCoverPackages(roots []*Package, match []func(*Package) bool, op strin
        return covered
 }
 
-// declareCoverVars attaches the required cover variables names
+// DeclareCoverVars attaches the required cover variables names
 // to the files, to be used when annotating the files. This
 // function only called when using legacy coverage test/build
 // (e.g. GOEXPERIMENT=coverageredesign is off).
index 08a474f61b3ab5d2c36d91dd68af59f56a8a33cc..d0beff548529cf47c5ab38e8f99bc8576b74c123 100644 (file)
@@ -547,7 +547,7 @@ func (r *resolver) queryModule(ctx context.Context, mPath, query string, selecte
        return module.Version{Path: mPath, Version: rev.Version}, nil
 }
 
-// queryPackage wraps modload.QueryPackage, substituting r.checkAllowedOr to
+// queryPackages wraps modload.QueryPackage, substituting r.checkAllowedOr to
 // decide allowed versions.
 func (r *resolver) queryPackages(ctx context.Context, pattern, query string, selected func(string) string) (pkgMods []module.Version, err error) {
        results, err := modload.QueryPackages(ctx, pattern, query, selected, r.checkAllowedOr(query, selected))
index c107a02c248fdce4e0293e9182ff5a90366aa47f..60953fdee33619128f20f6df7ab6c69b02f23b28 100644 (file)
@@ -45,20 +45,20 @@ func (m *Match) AddError(err error) {
        m.Errs = append(m.Errs, &MatchError{Match: m, Err: err})
 }
 
-// Literal reports whether the pattern is free of wildcards and meta-patterns.
+// IsLiteral reports whether the pattern is free of wildcards and meta-patterns.
 //
 // A literal pattern must match at most one package.
 func (m *Match) IsLiteral() bool {
        return !strings.Contains(m.pattern, "...") && !m.IsMeta()
 }
 
-// Local reports whether the pattern must be resolved from a specific root or
+// IsLocal reports whether the pattern must be resolved from a specific root or
 // directory, such as a filesystem path or a single module.
 func (m *Match) IsLocal() bool {
        return build.IsLocalImport(m.pattern) || filepath.IsAbs(m.pattern)
 }
 
-// Meta reports whether the pattern is a “meta-package” keyword that represents
+// IsMeta reports whether the pattern is a “meta-package” keyword that represents
 // multiple packages, such as "std", "cmd", or "all".
 func (m *Match) IsMeta() bool {
        return IsMetaPackage(m.pattern)
index 12ea0524826d81d5da524de46ebe13cfc5d5ded7..ef54c6626de1249aefacf4646b965700bc4e6598 100644 (file)
@@ -759,7 +759,7 @@ func (v *Cmd) Tags(dir string) ([]string, error) {
        return tags, nil
 }
 
-// tagSync syncs the repo in dir to the named tag,
+// TagSync syncs the repo in dir to the named tag,
 // which either is a tag returned by tags or is v.tagDefault.
 func (v *Cmd) TagSync(dir, tag string) error {
        if v.TagSyncCmd == nil {
index a3b7787720c783d60eaff7c9a454cead75a48c5f..cd3e39afe0a1abf38d6f17e3c8cea309b3b8c483 100644 (file)
@@ -44,7 +44,7 @@ var impatientInsecureHTTPClient = &http.Client{
 
 var securityPreservingDefaultClient = securityPreservingHTTPClient(http.DefaultClient)
 
-// securityPreservingDefaultClient returns a client that is like the original
+// securityPreservingHTTPClient returns a client that is like the original
 // but rejects redirects to plain-HTTP URLs if the original URL was secure.
 func securityPreservingHTTPClient(original *http.Client) *http.Client {
        c := new(http.Client)
index d6fa847be043a896c6ec8c0eedd80976627af29f..7f2924f73d5055ccbfcd6333c25d58ce7a7928c1 100644 (file)
@@ -64,7 +64,7 @@ func actionList(root *Action) []*Action {
        return all
 }
 
-// do runs the action graph rooted at root.
+// Do runs the action graph rooted at root.
 func (b *Builder) Do(ctx context.Context, root *Action) {
        ctx, span := trace.StartSpan(ctx, "exec.Builder.Do ("+root.Mode+" "+root.Target+")")
        defer span.Done()
@@ -2060,7 +2060,7 @@ func (b *Builder) fmtcmd(dir string, format string, args ...any) string {
        return cmd
 }
 
-// showcmd prints the given command to standard output
+// Showcmd prints the given command to standard output
 // for the implementation of -n or -x.
 func (b *Builder) Showcmd(dir string, format string, args ...any) {
        b.output.Lock()
@@ -2311,7 +2311,7 @@ func (b *Builder) cCompilerEnv() []string {
        return []string{"TERM=dumb"}
 }
 
-// mkdir makes the named directory.
+// Mkdir makes the named directory.
 func (b *Builder) Mkdir(dir string) error {
        // Make Mkdir(a.Objdir) a no-op instead of an error when a.Objdir == "".
        if dir == "" {
@@ -2340,7 +2340,7 @@ func (b *Builder) Mkdir(dir string) error {
        return nil
 }
 
-// symlink creates a symlink newname -> oldname.
+// Symlink creates a symlink newname -> oldname.
 func (b *Builder) Symlink(oldname, newname string) error {
        // It's not an error to try to recreate an existing symlink.
        if link, err := os.Readlink(newname); err == nil && link == oldname {
@@ -2583,13 +2583,13 @@ func (b *Builder) gccld(a *Action, p *load.Package, objdir, outfile string, flag
        return err
 }
 
-// gccCmd returns a gcc command line prefix
+// GccCmd returns a gcc command line prefix
 // defaultCC is defined in zdefaultcc.go, written by cmd/dist.
 func (b *Builder) GccCmd(incdir, workdir string) []string {
        return b.compilerCmd(b.ccExe(), incdir, workdir)
 }
 
-// gxxCmd returns a g++ command line prefix
+// GxxCmd returns a g++ command line prefix
 // defaultCXX is defined in zdefaultcc.go, written by cmd/dist.
 func (b *Builder) GxxCmd(incdir, workdir string) []string {
        return b.compilerCmd(b.cxxExe(), incdir, workdir)
index e35a418e17e6f623bac1c859681de4ca5373605c..8ac50e202f7a8da2bafbab170d294ab9269acb6e 100644 (file)
@@ -189,7 +189,7 @@ func (r *objReader) readByte() byte {
        return b
 }
 
-// read reads exactly len(b) bytes from the input file.
+// readFull reads exactly len(b) bytes from the input file.
 // If an error occurs, read returns the error but also
 // records it, so it is safe for callers to ignore the result
 // as long as delaying the report is not a problem.
index 984d0c69ca8be6aa69ea8d3a5997c829e2f91e03..8853926afe9eae2b2401d696330278e3133e067d 100644 (file)
@@ -12,7 +12,7 @@ import (
        "unicode"
 )
 
-// Conversion type-checks the conversion T(x).
+// conversion type-checks the conversion T(x).
 // The result is in x.
 func (check *Checker) conversion(x *operand, T Type) {
        constArg := x.mode == constant_
index 45d591e31cf4233e78023159820d6b542433e7b4..2fcc3f3492fc89561716b88a2cd9621c43478253 100644 (file)
@@ -408,7 +408,7 @@ func (check *Checker) isValidIndex(x *operand, code Code, what string, allowNega
        return true
 }
 
-// indexElts checks the elements (elts) of an array or slice composite literal
+// indexedElts checks the elements (elts) of an array or slice composite literal
 // against the literal's element type (typ), and the element indices against
 // the literal length if known (length >= 0). It returns the length of the
 // literal (maximum index value + 1).
index 8a03171ee52c0e21043a3e32cd08ede77c331d58..42418a693cf36c05d1fb9a33ed222a7af12720f1 100644 (file)
@@ -6,7 +6,7 @@
 
 package syscall
 
-// TimespecToNSec returns the time stored in ts as nanoseconds.
+// TimespecToNsec returns the time stored in ts as nanoseconds.
 func TimespecToNsec(ts Timespec) int64 { return ts.Nano() }
 
 // NsecToTimespec converts a number of nanoseconds into a Timespec.