summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/tools/internal
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-08-10 15:05:54 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-08-10 15:05:54 +0200
commit67100809b399b60e58490fa8b1c0a72be75ac820 (patch)
treeae6df939bf9fe557a766120bee3363f89b47f961 /vendor/golang.org/x/tools/internal
parent[feature + performance] add JSON logging format (#4355) (diff)
downloadgotosocial-67100809b399b60e58490fa8b1c0a72be75ac820.tar.xz
[chore] update dependencies (#4361)
- codeberg.org/gruf/go-kv/v2 v2.0.5 => v2.0.6 - github.com/coreos/go-oidc/v3 v3.14.1 => v3.15.0 - github.com/miekg/dns v1.1.67 => v1.1.68 - github.com/tdewolff/minify/v2 v2.23.9 => v2.23.11 - github.com/yuin/goldmark v1.7.12 => v1.7.13 - golang.org/x/crypto v0.40.0 => v0.41.0 - golang.org/x/image v0.29.0 => v0.30.0 - golang.org/x/net v0.42.0 => v0.43.0 - golang.org/x/sys v0.34.0 => v0.35.0 - golang.org/x/text v0.27.0 => v0.28.0 - modernc.org/sqlite v1.38.0 => v1.38.2 Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4361 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/golang.org/x/tools/internal')
-rw-r--r--vendor/golang.org/x/tools/internal/modindex/lookup.go16
-rw-r--r--vendor/golang.org/x/tools/internal/packagesinternal/packages.go6
2 files changed, 14 insertions, 8 deletions
diff --git a/vendor/golang.org/x/tools/internal/modindex/lookup.go b/vendor/golang.org/x/tools/internal/modindex/lookup.go
index 34e3673ff..0c011a99b 100644
--- a/vendor/golang.org/x/tools/internal/modindex/lookup.go
+++ b/vendor/golang.org/x/tools/internal/modindex/lookup.go
@@ -36,13 +36,13 @@ const (
)
// LookupAll only returns those Candidates whose import path
-// finds all the nms.
-func (ix *Index) LookupAll(pkg string, names ...string) map[string][]Candidate {
+// finds all the names.
+func (ix *Index) LookupAll(pkgName string, names ...string) map[string][]Candidate {
// this can be made faster when benchmarks show that it needs to be
names = uniquify(names)
byImpPath := make(map[string][]Candidate)
for _, nm := range names {
- cands := ix.Lookup(pkg, nm, false)
+ cands := ix.Lookup(pkgName, nm, false)
for _, c := range cands {
byImpPath[c.ImportPath] = append(byImpPath[c.ImportPath], c)
}
@@ -67,9 +67,9 @@ func uniquify(in []string) []string {
// Lookup finds all the symbols in the index with the given PkgName and name.
// If prefix is true, it finds all of these with name as a prefix.
-func (ix *Index) Lookup(pkg, name string, prefix bool) []Candidate {
- loc, ok := slices.BinarySearchFunc(ix.Entries, pkg, func(e Entry, pkg string) int {
- return strings.Compare(e.PkgName, pkg)
+func (ix *Index) Lookup(pkgName, name string, prefix bool) []Candidate {
+ loc, ok := slices.BinarySearchFunc(ix.Entries, pkgName, func(e Entry, pkg string) int {
+ return strings.Compare(e.PkgName, pkgName)
})
if !ok {
return nil // didn't find the package
@@ -78,7 +78,7 @@ func (ix *Index) Lookup(pkg, name string, prefix bool) []Candidate {
// loc is the first entry for this package name, but there may be several
for i := loc; i < len(ix.Entries); i++ {
e := ix.Entries[i]
- if e.PkgName != pkg {
+ if e.PkgName != pkgName {
break // end of sorted package names
}
nloc, ok := slices.BinarySearchFunc(e.Names, name, func(s string, name string) int {
@@ -105,7 +105,7 @@ func (ix *Index) Lookup(pkg, name string, prefix bool) []Candidate {
continue // should never happen
}
px := Candidate{
- PkgName: pkg,
+ PkgName: pkgName,
Name: flds[0],
Dir: string(e.Dir),
ImportPath: e.ImportPath,
diff --git a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go
index 73eefa2a7..929b470be 100644
--- a/vendor/golang.org/x/tools/internal/packagesinternal/packages.go
+++ b/vendor/golang.org/x/tools/internal/packagesinternal/packages.go
@@ -5,6 +5,8 @@
// Package packagesinternal exposes internal-only fields from go/packages.
package packagesinternal
+import "fmt"
+
var GetDepsErrors = func(p any) []*PackageError { return nil }
type PackageError struct {
@@ -13,5 +15,9 @@ type PackageError struct {
Err string // the error itself
}
+func (err PackageError) String() string {
+ return fmt.Sprintf("%s: %s (import stack: %s)", err.Pos, err.Err, err.ImportStack)
+}
+
var TypecheckCgo int
var DepsErrors int // must be set as a LoadMode to call GetDepsErrors