diff --git a/.goreleaser.yml b/.goreleaser.yml index b072a4e..6f8696c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,11 +11,13 @@ builds: - CGO_ENABLED=0 goos: - linux + - windows - darwin archives: - replacements: darwin: Darwin linux: Linux + windows: Windows 386: i386 amd64: x86_64 checksum: diff --git a/go.mod b/go.mod index 5eea3a3..78585b2 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/boyter/go-string v1.0.5 - github.com/boyter/gocodewalker v1.1.0 + github.com/boyter/gocodewalker v1.1.1 github.com/fatih/color v1.15.0 github.com/gdamore/tcell v1.3.0 github.com/mattn/go-isatty v0.0.17 diff --git a/go.sum b/go.sum index df74437..e871ec1 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/boyter/go-string v1.0.5 h1:/xcOlWdgelLYLVkUU0xBLfioGjZ9KIMUMI/RXG138YY= github.com/boyter/go-string v1.0.5/go.mod h1:Mww9cDld2S2cdJ0tQffBhsZFMQRA2OJdcjWYZXvZ4Ss= -github.com/boyter/gocodewalker v1.1.0 h1:R/BOXRB5WcE5x/Q6Ln95GUQOQE4PAk86nq6WccZqZmM= -github.com/boyter/gocodewalker v1.1.0/go.mod h1:CppTdM9RtednxKPcit+Zn36FXqwYaDIGufs/tenbswo= +github.com/boyter/gocodewalker v1.1.1 h1:Mst/UL+Mu8ZGezEdsDFI+bZmvBHbKn6qO3GvzS6UwAQ= +github.com/boyter/gocodewalker v1.1.1/go.mod h1:l3OQnRDklRvyaz+IGsu0Tw86nX4p4WqwopMRQm+5o54= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= diff --git a/vendor/github.com/boyter/gocodewalker/README.md b/vendor/github.com/boyter/gocodewalker/README.md index dbe8ec6..4da09cf 100644 --- a/vendor/github.com/boyter/gocodewalker/README.md +++ b/vendor/github.com/boyter/gocodewalker/README.md @@ -3,7 +3,15 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/boyter/gocodewalker)](https://goreportcard.com/report/github.com/boyter/gocodewalker) [![Str Count Badge](https://sloc.xyz/github/boyter/gocodewalker/)](https://github.com/boyter/gocodewalker/) -Library to help with walking of code directories in Go +Library to help with walking of code directories in Go. + +The problem. You want to walk the directories of a code repository. You want to respect .gitignore and .ignore files, and +some are nested. This library is the answer. + + - Designed to walk code repositories or find the root of them. + - By default, respects both .gitignore and .ignore files (can be disabled) and nested ones for accuracy + - Has configurable options for skipping files based on regex, extension or general match + - Uses readdir to provide as fast as possible file walking NB this was moved from go-code-walker due to the name being annoying and to ensure it has a unique package name. Should still be drop in replaceable so long as you refer to the new package name. @@ -15,7 +23,7 @@ or looking for the root directory assuming already in a git project. Example of usage, -``` +```go fileListQueue := make(chan *gocodewalker.File, 100) fileWalker := gocodewalker.NewFileWalker(".", fileListQueue) @@ -41,7 +49,6 @@ The above by default will recursively add files to the fileListQueue respecting only adding files with the go extension into the queue. All code is dual-licenced as either MIT or Unlicence. -Note that as an Australian I cannot put this into the public domain, hence the choice most liberal licences I can find. ### Error Handler @@ -50,7 +57,7 @@ and decide if the walker should continue to process, or return. The simplest handler is the below, which if set will swallow all errors and continue as best it can. -``` +```go errorHandler := func(e error) bool { return true } @@ -59,7 +66,7 @@ fileWalker.SetErrorHandler(errorHandler) If you wanted to return on errors you could use the following. -``` +```go errorHandler := func(e error) bool { return false } @@ -69,7 +76,7 @@ fileWalker.SetErrorHandler(errorHandler) If you wanted to terminate walking on an error you could use the following, which would cause it to return the error, and then terminate all walking. This might be desirable where any error indicates a total failure. -``` +```go errorHandler := func(e error) bool { fileWalker.Terminate() return false diff --git a/vendor/github.com/boyter/gocodewalker/file.go b/vendor/github.com/boyter/gocodewalker/file.go index b8e62f1..db7a307 100644 --- a/vendor/github.com/boyter/gocodewalker/file.go +++ b/vendor/github.com/boyter/gocodewalker/file.go @@ -152,7 +152,7 @@ func (f *FileWalker) walkDirectoryRecursive(directory string, gitignores []gitig } defer d.Close() - foundFiles, err := d.ReadDir(-1) + foundFiles, err := d.Readdir(-1) if err != nil { // nothing we can do with this so return nil and process as best we can if f.errorsHandler(err) { @@ -161,8 +161,8 @@ func (f *FileWalker) walkDirectoryRecursive(directory string, gitignores []gitig return err } - files := []os.DirEntry{} - dirs := []os.DirEntry{} + files := []os.FileInfo{} + dirs := []os.FileInfo{} // We want to break apart the files and directories from the // return as we loop over them differently and this avoids some diff --git a/vendor/github.com/boyter/gocodewalker/hidden.go b/vendor/github.com/boyter/gocodewalker/hidden.go index 07b16d1..2a8347f 100644 --- a/vendor/github.com/boyter/gocodewalker/hidden.go +++ b/vendor/github.com/boyter/gocodewalker/hidden.go @@ -9,6 +9,6 @@ import ( ) // IsHidden Returns true if file is hidden -func IsHidden(file os.DirEntry, directory string) (bool, error) { +func IsHidden(file os.FileInfo, directory string) (bool, error) { return file.Name()[0:1] == ".", nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 81555f2..427dd59 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,7 +1,7 @@ # github.com/boyter/go-string v1.0.5 ## explicit; go 1.20 github.com/boyter/go-string -# github.com/boyter/gocodewalker v1.1.0 +# github.com/boyter/gocodewalker v1.1.1 ## explicit; go 1.20 github.com/boyter/gocodewalker github.com/boyter/gocodewalker/go-gitignore