mirror of
https://github.com/akyaiy/GoSally-mvp.git
synced 2026-01-07 19:12:25 +00:00
um add modernc/sqlite
This commit is contained in:
45
vendor/github.com/sagikazarmark/locafero/finder.go
generated
vendored
45
vendor/github.com/sagikazarmark/locafero/finder.go
generated
vendored
@@ -7,7 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/sourcegraph/conc/iter"
|
||||
"github.com/sourcegraph/conc/pool"
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
@@ -44,47 +44,22 @@ type Finder struct {
|
||||
// Find looks for files and directories in an [afero.Fs] filesystem.
|
||||
func (f Finder) Find(fsys afero.Fs) ([]string, error) {
|
||||
// Arbitrary go routine limit (TODO: make this a parameter)
|
||||
// pool := pool.NewWithResults[[]string]().WithMaxGoroutines(5).WithErrors().WithFirstError()
|
||||
|
||||
type searchItem struct {
|
||||
path string
|
||||
name string
|
||||
}
|
||||
|
||||
var searchItems []searchItem
|
||||
p := pool.NewWithResults[[]string]().WithMaxGoroutines(5).WithErrors().WithFirstError()
|
||||
|
||||
for _, searchPath := range f.Paths {
|
||||
searchPath := searchPath
|
||||
|
||||
for _, searchName := range f.Names {
|
||||
searchName := searchName
|
||||
p.Go(func() ([]string, error) {
|
||||
// If the name contains any glob character, perform a glob match
|
||||
if strings.ContainsAny(searchName, globMatch) {
|
||||
return globWalkSearch(fsys, searchPath, searchName, f.Type)
|
||||
}
|
||||
|
||||
searchItems = append(searchItems, searchItem{searchPath, searchName})
|
||||
|
||||
// pool.Go(func() ([]string, error) {
|
||||
// // If the name contains any glob character, perform a glob match
|
||||
// if strings.ContainsAny(searchName, globMatch) {
|
||||
// return globWalkSearch(fsys, searchPath, searchName, f.Type)
|
||||
// }
|
||||
//
|
||||
// return statSearch(fsys, searchPath, searchName, f.Type)
|
||||
// })
|
||||
return statSearch(fsys, searchPath, searchName, f.Type)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// allResults, err := pool.Wait()
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
allResults, err := iter.MapErr(searchItems, func(item *searchItem) ([]string, error) {
|
||||
// If the name contains any glob character, perform a glob match
|
||||
if strings.ContainsAny(item.name, globMatch) {
|
||||
return globWalkSearch(fsys, item.path, item.name, f.Type)
|
||||
}
|
||||
|
||||
return statSearch(fsys, item.path, item.name, f.Type)
|
||||
})
|
||||
allResults, err := p.Wait()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
12
vendor/github.com/sagikazarmark/locafero/flake.lock
generated
vendored
12
vendor/github.com/sagikazarmark/locafero/flake.lock
generated
vendored
@@ -37,11 +37,11 @@
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1742998885,
|
||||
"narHash": "sha256-xd2EwpUr+f/LLQjuKvFjXMe/fVyOAXkrKy986hMMuqs=",
|
||||
"lastModified": 1743514249,
|
||||
"narHash": "sha256-OSz+jUjTWXsuO27QhwgoLSPR4VZSCWVY3Et1CwshDiA=",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "4e56212b1781ab297b506bfca0085bb0e8ba1cfb",
|
||||
"rev": "6d92924d2c9df24c05f59527260d216d17f8692f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -267,11 +267,11 @@
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1742889210,
|
||||
"narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=",
|
||||
"lastModified": 1743315132,
|
||||
"narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "698214a32beb4f4c8e3942372c694f40848b360d",
|
||||
"rev": "52faf482a3889b7619003c0daec593a1912fddc1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
2
vendor/github.com/sagikazarmark/locafero/justfile
generated
vendored
2
vendor/github.com/sagikazarmark/locafero/justfile
generated
vendored
@@ -2,7 +2,7 @@ default:
|
||||
just --list
|
||||
|
||||
test:
|
||||
go test -race -v ./...
|
||||
go test -count 10 -shuffle on -race -v ./...
|
||||
|
||||
fuzz:
|
||||
go test -race -v -fuzz=Fuzz -fuzztime=60s ./...
|
||||
|
||||
Reference in New Issue
Block a user