func (fileIndex FileIndex) BuildIndexForDirectory(dirPath string) error {
	log.Println("[DEBUG]", "Building index for path:", dirPath)
	err := filepath.Walk(dirPath, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if !info.IsDir() {
			err := fileIndex.AddFileToIndex(path)
			if err != nil {
				log.Println("[WARN]", "Skipping", path, ":", err)
			}
		} else {
			fileIndex.hashedDirectories[path] = true
		}
		return nil
	})
	if err != nil {
		return err
	}
	fileIndex.hashedDirectories[dirPath] = true
	return nil
}
// BuildIndexForDirectory recursively scans the given directory and indexes all the files contained within.
BuildIndexForDirectory recursively scans the given directory and indexes all the files contained within.
// BuildIndexForDirectory recursively scans the given directory and indexes all the files contained within .
func (fileIndex FileIndex) BuildIndexForDirectory(dirPath string) error {
	log.Println("[DEBUG]", "Building index for path:", dirPath)
	err := filepath.Walk(dirPath, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if !info.IsDir() {
			err := fileIndex.AddFileToIndex(path)
			if err != nil {
				log.Println("[WARN]", "Skipping", path, ":", err)
			}
		} else {
			fileIndex.hashedDirectories[path] = true
		}
		return nil
	})
	if err != nil {
		return err
	}
	fileIndex.hashedDirectories[dirPath] = true
	return nil
}
func ( fileIndex FileIndex ) BuildIndexForDirectory ( dirPath string ) error { log . Println ( " " , " " , dirPath ) err := filepath . Walk ( dirPath , func ( path string , info os . FileInfo , err error ) error { if err != nil { return err } if ! info . IsDir ( ) { err := fileIndex . AddFileToIndex ( path ) if err != nil { log . Println ( " " , " " , path , " " , err ) } } else { fileIndex . hashedDirectories [ path ] = true } return nil } ) if err != nil { return err } fileIndex . hashedDirectories [ dirPath ] = true return nil }
BuildIndexForDirectory recursively scans the given directory and indexes all the files contained within.
BuildIndexForDirectory recursively scans the given directory and indexes all the files contained within .