Skip to content

jorgemarey/filelib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

filelib

Simple Golang library to search for files that match some criteria.

Just:

import (
  // Import the library
  "filelib"
  "fmt"
  "os"
  "strings"
)

func main() {
  // Create a function. This will be used against the files and
  // only those who match will be returned.
  match := func(fi os.FileInfo, fn string) bool {
    return !fi.IsDir() && strings.Contains(fn, "awesome")
  }
  // Search for them!
  files := filelib.Search(match, os.Args[1:]...)
  // filelib.Search return a channel
  for f := range files {
    fmt.Println(f)
  }
}

About

Simple file search

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages