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 "()"
*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,
}
}
-// 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
"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_
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).
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))
}
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)
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
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
}
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).
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))
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)
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 {
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)
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()
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()
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 == "" {
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 {
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)
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.
"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_
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).
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.