func generateFromPath(w io.Writer, rootPath string) error {
	return filepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if !strings.HasSuffix(path, ".proto") {
			return nil
		}
		relPath, err := filepath.Rel(rootPath, path)
		if err != nil || strings.HasPrefix(relPath, "..") {
			log.Panicf("file %q not in repository rootPath %q", path, rootPath)
		}
		relPath = filepath.ToSlash(relPath)

		if strings.HasPrefix(relPath, "google/api/experimental/") {
			// Special case: these protos need to be built together with protos in
			// google/api. They have the same 'option go_package'. The proto_library
			// rule requires them to be in the same Bazel package, so we don't
			// create a build file in experimental.
			packagePath := "google.golang.org/genproto/googleapis/api"
			protoLabel, goLabel := protoLabels("google/api/x", "api")
			fmt.Fprintf(w, "%s,%s,%s,%s\n", relPath, protoLabel, packagePath, goLabel)
			return nil
		}

		packagePath, packageName, err := loadGoPackage(path)
		if err != nil {
			log.Print(err)
			return nil
		}

		protoLabel, goLabel := protoLabels(relPath, packageName)

		fmt.Fprintf(w, "%s,%s,%s,%s\n", relPath, protoLabel, packagePath, goLabel)
		return nil
	})
}
func generateFromPath(w io.Writer, rootPath string) error {
	return filepath.Walk(rootPath, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if !strings.HasSuffix(path, ".proto") {
			return nil
		}
		relPath, err := filepath.Rel(rootPath, path)
		if err != nil || strings.HasPrefix(relPath, "..") {
			log.Panicf("file %q not in repository rootPath %q", path, rootPath)
		}
		relPath = filepath.ToSlash(relPath)

		if strings.HasPrefix(relPath, "google/api/experimental/") {
			
			
			
			
			packagePath := "google.golang.org/genproto/googleapis/api"
			protoLabel, goLabel := protoLabels("google/api/x", "api")
			fmt.Fprintf(w, "%s,%s,%s,%s\n", relPath, protoLabel, packagePath, goLabel)
			return nil
		}

		packagePath, packageName, err := loadGoPackage(path)
		if err != nil {
			log.Print(err)
			return nil
		}

		protoLabel, goLabel := protoLabels(relPath, packageName)

		fmt.Fprintf(w, "%s,%s,%s,%s\n", relPath, protoLabel, packagePath, goLabel)
		return nil
	})
}
func generateFromPath ( w io . Writer , rootPath string ) error { return filepath . Walk ( rootPath , func ( path string , info os . FileInfo , err error ) error { if err != nil { return err } if ! strings . HasSuffix ( path , " " ) { return nil } relPath , err := filepath . Rel ( rootPath , path ) if err != nil || strings . HasPrefix ( relPath , " " ) { log . Panicf ( " " , path , rootPath ) } relPath = filepath . ToSlash ( relPath ) if strings . HasPrefix ( relPath , " " ) { // Special case: these protos need to be built together with protos in // google/api. They have the same 'option go_package'. The proto_library // rule requires them to be in the same Bazel package, so we don't // create a build file in experimental. packagePath := " " protoLabel , goLabel := protoLabels ( " " , " " ) fmt . Fprintf ( w , " \n " , relPath , protoLabel , packagePath , goLabel ) return nil } packagePath , packageName , err := loadGoPackage ( path ) if err != nil { log . Print ( err ) return nil } protoLabel , goLabel := protoLabels ( relPath , packageName ) fmt . Fprintf ( w , " \n " , relPath , protoLabel , packagePath , goLabel ) return nil } ) }
//
// Process -go_googleapis case
//
Process - go_googleapis case