code: func WalkPkg(pkgName string, visit VisitFunc) error {
  	// Visit the package itself.
  	pkg, err := findPackage(pkgName)
  	if err != nil {
  		return err
  	}
  	if err := visit(pkg.ImportPath, pkg.Dir); err == ErrSkipPkg {
  		return nil
  	} else if err != nil {
  		return err
  	}
  
  	// Read all of the child dirents and find sub-packages.
  	infos, err := readDirInfos(pkg.Dir)
  	if err != nil {
  		return err
  	}
  	for _, info := range infos {
  		if !info.IsDir() {
  			continue
  		}
  		name := info.Name()
  		if name[0] == '_' || (len(name) > 1 && name[0] == '.') || name == "testdata" {
  			continue
  		}
  		// Don't use path.Join() because it drops leading `./` via path.Clean().
  		err := WalkPkg(pkgName+"/"+name, visit)
  		if err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // WalkPkg recursively visits all packages under pkgName.  This is similar
  // to filepath.Walk, except that it follows symlinks.  A package is always
  // visited before the children of that package.  If visit returns ErrSkipPkg,
  // pkgName will not be walked.