From 7d6c151296009cb0acf061159523effc32358a97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 09:20:52 +0000 Subject: [PATCH] Bump github.com/sahilm/fuzzy from 0.1.0 to 0.1.1 Bumps [github.com/sahilm/fuzzy](https://github.com/sahilm/fuzzy) from 0.1.0 to 0.1.1. - [Release notes](https://github.com/sahilm/fuzzy/releases) - [Commits](https://github.com/sahilm/fuzzy/compare/v0.1.0...v0.1.1) --- updated-dependencies: - dependency-name: github.com/sahilm/fuzzy dependency-version: 0.1.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/sahilm/fuzzy/.travis.yml | 3 +++ vendor/github.com/sahilm/fuzzy/README.md | 8 +++++--- vendor/github.com/sahilm/fuzzy/fuzzy.go | 21 ++++++++++++++++++++- vendor/modules.txt | 2 +- 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 0dee2b179..74dfa0c7a 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/mgutz/str v1.2.0 github.com/mitchellh/go-ps v1.0.0 github.com/rivo/uniseg v0.4.7 - github.com/sahilm/fuzzy v0.1.0 + github.com/sahilm/fuzzy v0.1.1 github.com/samber/lo v1.31.0 github.com/sanity-io/litter v1.5.8 github.com/sasha-s/go-deadlock v0.3.6 diff --git a/go.sum b/go.sum index 676fbf4d3..7a7be43f2 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= -github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= -github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= +github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA= +github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/samber/lo v1.31.0 h1:Sfa+/064Tdo4SvlohQUQzBhgSer9v/coGvKQI/XLWAM= github.com/samber/lo v1.31.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8= github.com/sanity-io/litter v1.5.8 h1:uM/2lKrWdGbRXDrIq08Lh9XtVYoeGtcQxk9rtQ7+rYg= diff --git a/vendor/github.com/sahilm/fuzzy/.travis.yml b/vendor/github.com/sahilm/fuzzy/.travis.yml index 6756d8009..f77acde75 100644 --- a/vendor/github.com/sahilm/fuzzy/.travis.yml +++ b/vendor/github.com/sahilm/fuzzy/.travis.yml @@ -1,3 +1,6 @@ +arch: + - amd64 + - ppc64le language: go go: - 1.x diff --git a/vendor/github.com/sahilm/fuzzy/README.md b/vendor/github.com/sahilm/fuzzy/README.md index c632da5d9..ea7bf22b2 100644 --- a/vendor/github.com/sahilm/fuzzy/README.md +++ b/vendor/github.com/sahilm/fuzzy/README.md @@ -17,7 +17,7 @@ VSCode, IntelliJ IDEA et al. This library is external dependency-free. It only d - Speed. Matches are returned in milliseconds. It's perfect for interactive search boxes. -- The positions of matches is returned. Allows you to highlight matching characters. +- The positions of matches are returned. Allows you to highlight matching characters. - Unicode aware. @@ -76,7 +76,7 @@ func contains(needle int, haystack []int) bool { return false } ``` -If the data you want to match isn't a slice of strings, you can use `FindFromSource` by implementing +If the data you want to match isn't a slice of strings, you can use `FindFrom` by implementing the provided `Source` interface. Here's an example: ```go @@ -119,7 +119,9 @@ func main() { }, } results := fuzzy.FindFrom("al", emps) - fmt.Println(results) + for _, r := range results { + fmt.Println(emps[r.Index]) + } } ``` diff --git a/vendor/github.com/sahilm/fuzzy/fuzzy.go b/vendor/github.com/sahilm/fuzzy/fuzzy.go index bd66ee66c..5125821fd 100644 --- a/vendor/github.com/sahilm/fuzzy/fuzzy.go +++ b/vendor/github.com/sahilm/fuzzy/fuzzy.go @@ -76,16 +76,36 @@ The following types of matches apply a bonus: Penalties are applied for every character in the search string that wasn't matched and all leading characters upto the first match. + +Results are sorted by best match. */ func Find(pattern string, data []string) Matches { return FindFrom(pattern, stringSource(data)) } +/* +FindNoSort is an alternative Find implementation that does not sort +the results in the end. +*/ +func FindNoSort(pattern string, data []string) Matches { + return FindFromNoSort(pattern, stringSource(data)) +} + /* FindFrom is an alternative implementation of Find using a Source instead of a list of strings. */ func FindFrom(pattern string, data Source) Matches { + matches := FindFromNoSort(pattern, data) + sort.Stable(matches) + return matches +} + +/* +FindFromNoSort is an alternative FindFrom implementation that does +not sort results in the end. +*/ +func FindFromNoSort(pattern string, data Source) Matches { if len(pattern) == 0 { return nil } @@ -181,7 +201,6 @@ func FindFrom(pattern string, data Source) Matches { matchedIndexes = match.MatchedIndexes[:0] // Recycle match index slice } } - sort.Stable(matches) return matches } diff --git a/vendor/modules.txt b/vendor/modules.txt index dd8c3747f..9b2236fec 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -156,7 +156,7 @@ github.com/pmezard/go-difflib/difflib github.com/rivo/uniseg # github.com/rogpeppe/go-internal v1.14.1 ## explicit; go 1.23 -# github.com/sahilm/fuzzy v0.1.0 +# github.com/sahilm/fuzzy v0.1.1 ## explicit github.com/sahilm/fuzzy # github.com/samber/lo v1.31.0