src/cmd: fix a few function names on comments

Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
cui fliter 2022-09-29 20:34:50 +08:00
parent 690851ee3e
commit cfd1e1091a
11 changed files with 15 additions and 15 deletions

View file

@ -309,7 +309,7 @@ func xreaddir(dir string) []string {
return names return names
} }
// xreaddir replaces dst with a list of the names of the files in dir. // xreaddirfiles replaces dst with a list of the names of the files in dir.
// The names are relative to dir; they are not full paths. // The names are relative to dir; they are not full paths.
func xreaddirfiles(dir string) []string { func xreaddirfiles(dir string) []string {
f, err := os.Open(dir) f, err := os.Open(dir)

View file

@ -293,7 +293,7 @@ func makeExprList(a []*ast.Ident) []ast.Expr {
return b return b
} }
// Typecheck1 is the recursive form of typecheck. // typecheck1 is the recursive form of typecheck.
// It is like typecheck but adds to the information in typeof // It is like typecheck but adds to the information in typeof
// instead of allocating a new map. // instead of allocating a new map.
func typecheck1(cfg *TypeConfig, f any, typeof map[any]string, assign map[string][]any) { func typecheck1(cfg *TypeConfig, f any, typeof map[any]string, assign map[string][]any) {

View file

@ -94,7 +94,7 @@ func (n *node) isDeleted() bool {
var overlay map[string]*node // path -> file or directory node var overlay map[string]*node // path -> file or directory node
var cwd string // copy of base.Cwd() to avoid dependency var cwd string // copy of base.Cwd() to avoid dependency
// Canonicalize a path for looking it up in the overlay. // canonicalize a path for looking it up in the overlay.
// Important: filepath.Join(cwd, path) doesn't always produce // Important: filepath.Join(cwd, path) doesn't always produce
// the correct absolute path if path is relative, because on // the correct absolute path if path is relative, because on
// Windows producing the correct absolute path requires making // Windows producing the correct absolute path requires making
@ -507,7 +507,7 @@ func Walk(root string, walkFn filepath.WalkFunc) error {
return err return err
} }
// lstat implements a version of os.Lstat that operates on the overlay filesystem. // Lstat implements a version of os.Lstat that operates on the overlay filesystem.
func Lstat(path string) (fs.FileInfo, error) { func Lstat(path string) (fs.FileInfo, error) {
Trace("Lstat", path) Trace("Lstat", path)
return overlayStat(path, os.Lstat, "lstat") return overlayStat(path, os.Lstat, "lstat")

View file

@ -69,7 +69,7 @@ func indexModule(modroot string) ([]byte, error) {
return encodeModuleBytes(packages), nil return encodeModuleBytes(packages), nil
} }
// indexModule indexes the package at the given directory and returns its // indexPackage indexes the package at the given directory and returns its
// encoded representation. It returns ErrNotIndexed if the package can't // encoded representation. It returns ErrNotIndexed if the package can't
// be indexed. // be indexed.
func indexPackage(modroot, pkgdir string) []byte { func indexPackage(modroot, pkgdir string) []byte {
@ -115,7 +115,7 @@ func parseErrorToString(err error) string {
return string(s) return string(s)
} }
// parseErrorFrom string converts a string produced by parseErrorToString back // parseErrorFromString converts a string produced by parseErrorToString back
// to an error. An empty string is converted to a nil error, and all // to an error. An empty string is converted to a nil error, and all
// other strings are expected to be JSON-marshalled parseError structs. // other strings are expected to be JSON-marshalled parseError structs.
// The two functions are meant to preserve the structure of an // The two functions are meant to preserve the structure of an

View file

@ -1665,7 +1665,7 @@ const (
addBuildListZipSums addBuildListZipSums
) )
// modKey returns the module.Version under which the checksum for m's go.mod // modkey returns the module.Version under which the checksum for m's go.mod
// file is stored in the go.sum file. // file is stored in the go.sum file.
func modkey(m module.Version) module.Version { func modkey(m module.Version) module.Version {
return module.Version{Path: m.Path, Version: m.Version + "/go.mod"} return module.Version{Path: m.Path, Version: m.Version + "/go.mod"}

View file

@ -235,7 +235,7 @@ func parsePathVersionOptional(adj, arg string, allowDirPath bool) (path, version
return path, version, nil return path, version, nil
} }
// flagReplace implements the -replace flag. // flagEditworkReplace implements the -replace flag.
func flagEditworkReplace(arg string) { func flagEditworkReplace(arg string) {
var i int var i int
if i = strings.Index(arg, "="); i < 0 { if i = strings.Index(arg, "="); i < 0 {
@ -264,7 +264,7 @@ func flagEditworkReplace(arg string) {
}) })
} }
// flagDropReplace implements the -dropreplace flag. // flagEditworkDropReplace implements the -dropreplace flag.
func flagEditworkDropReplace(arg string) { func flagEditworkDropReplace(arg string) {
path, version, err := parsePathVersionOptional("old", arg, true) path, version, err := parsePathVersionOptional("old", arg, true)
if err != nil { if err != nil {

View file

@ -396,7 +396,7 @@ func expandPseudoForm(form uint8) uint8 {
return uint8(expandedForm) return uint8(expandedForm)
} }
// Abbrevs() returns the finalized abbrev array for the platform, // Abbrevs returns the finalized abbrev array for the platform,
// expanding any DW_FORM pseudo-ops to real values. // expanding any DW_FORM pseudo-ops to real values.
func Abbrevs() []dwAbbrev { func Abbrevs() []dwAbbrev {
if abbrevsFinalized { if abbrevsFinalized {
@ -1719,7 +1719,7 @@ func (s byChildIndex) Len() int { return len(s) }
func (s byChildIndex) Less(i, j int) bool { return s[i].ChildIndex < s[j].ChildIndex } func (s byChildIndex) Less(i, j int) bool { return s[i].ChildIndex < s[j].ChildIndex }
func (s byChildIndex) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s byChildIndex) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
// IsDWARFEnabledOnAIX returns true if DWARF is possible on the // IsDWARFEnabledOnAIXLd returns true if DWARF is possible on the
// current extld. // current extld.
// AIX ld doesn't support DWARF with -bnoobjreorder with version // AIX ld doesn't support DWARF with -bnoobjreorder with version
// prior to 7.2.2. // prior to 7.2.2.

View file

@ -116,7 +116,7 @@ func mkbuiltin(w io.Writer) {
fmt.Fprintln(w, "}") fmt.Fprintln(w, "}")
} }
// addBasicTypes returns the symbol names for basic types that are // enumerateBasicTypes returns the symbol names for basic types that are
// defined in the runtime and referenced in other packages. // defined in the runtime and referenced in other packages.
// Needs to be kept in sync with reflect.go:WriteBasicTypes() and // Needs to be kept in sync with reflect.go:WriteBasicTypes() and
// reflect.go:writeType() in the compiler. // reflect.go:writeType() in the compiler.

View file

@ -369,7 +369,7 @@ type PCIter struct {
Done bool Done bool
} }
// newPCIter creates a PCIter with a scale factor for the PC step size. // NewPCIter creates a PCIter with a scale factor for the PC step size.
func NewPCIter(pcScale uint32) *PCIter { func NewPCIter(pcScale uint32) *PCIter {
it := new(PCIter) it := new(PCIter)
it.PCScale = pcScale it.PCScale = pcScale

View file

@ -233,7 +233,7 @@ func Dconv(p *Prog, a *Addr) string {
return buf.String() return buf.String()
} }
// DconvDconvWithABIDetail accepts an argument 'a' within a prog 'p' // DconvWithABIDetail accepts an argument 'a' within a prog 'p'
// and returns a string with a formatted version of the argument, in // and returns a string with a formatted version of the argument, in
// which text symbols are rendered with explicit ABI selectors. // which text symbols are rendered with explicit ABI selectors.
func DconvWithABIDetail(p *Prog, a *Addr) string { func DconvWithABIDetail(p *Prog, a *Addr) string {

View file

@ -412,7 +412,7 @@ func writeElementSec(ctxt *ld.Link, numImports, numFns uint64) {
writeSecSize(ctxt, sizeOffset) writeSecSize(ctxt, sizeOffset)
} }
// writeElementSec writes the section that provides the function bodies for the functions // writeCodeSec writes the section that provides the function bodies for the functions
// declared by the "func" section. // declared by the "func" section.
func writeCodeSec(ctxt *ld.Link, fns []*wasmFunc) { func writeCodeSec(ctxt *ld.Link, fns []*wasmFunc) {
sizeOffset := writeSecHeader(ctxt, sectionCode) sizeOffset := writeSecHeader(ctxt, sectionCode)