Skip to content

Find files in your filesystem with Go. Work in progress, I'm just testing the language

Notifications You must be signed in to change notification settings

magdkudama/go-finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-finder

Build Status Go Walker

"Finder" is a simple library to find files in your filesystem (as it's name suggests), using pure Go (no external dependencies).

It's heavily inspired (I mean... it's a bad copy of...) on the awesome Symfony Finder Component

Please, don't use it until I write some tests (this library is just my playground). But feel free to help me improve the library, as it's my very first Go code.

Click to view documentation (auto-generated)

baby-gopher

Installation

go get github.com/magdkudama/go-finder

Quick Start

package main

import (
	"github.com/magdkudama/finder"
	"fmt"
)

func main() {
	results := finder.
		Create("/my/path/").
		Depth(1).
		Name(".go").
		Names([]string{".py",".json"}).
		NotName(".html").
		NotNames([]string{".xml",".yml"}).
		MinSize("2 K").
		MaxSize("4 Mi").
		ExcludeHidden().
		ExcludeVCS().
		Get()

	for _, element := range results {
		fmt.Println(element.Name())
	}
}

To Do

  • Support filtering by size Done! And supports defining min size and max size in a "fancy" format
  • Exclude hidden directories
  • Exclude VCS directories
  • Add documentation on methods

Contributors

  • Magd Kudama [magdkudama]

About

Find files in your filesystem with Go. Work in progress, I'm just testing the language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages