mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 20:37:12 +01:00
vendor: update golang.org/x/tools from 26f6a1b6802d to 5e2df02acb1e
This commit is contained in:
parent
8d75a5dbd0
commit
8a853778d7
3
go.mod
3
go.mod
@ -14,9 +14,8 @@ require (
|
|||||||
github.com/valyala/gozstd v1.6.4
|
github.com/valyala/gozstd v1.6.4
|
||||||
github.com/valyala/histogram v1.0.1
|
github.com/valyala/histogram v1.0.1
|
||||||
github.com/valyala/quicktemplate v1.4.1
|
github.com/valyala/quicktemplate v1.4.1
|
||||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
|
|
||||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
|
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
|
||||||
golang.org/x/tools v0.0.0-20200226180945-26f6a1b6802d // indirect
|
golang.org/x/tools v0.0.0-20200312153518-5e2df02acb1e // indirect
|
||||||
google.golang.org/api v0.20.0
|
google.golang.org/api v0.20.0
|
||||||
google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688 // indirect
|
google.golang.org/genproto v0.0.0-20200225123651-fc8f55426688 // indirect
|
||||||
gopkg.in/yaml.v2 v2.2.8
|
gopkg.in/yaml.v2 v2.2.8
|
||||||
|
4
go.sum
4
go.sum
@ -275,8 +275,8 @@ golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapK
|
|||||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20200226180945-26f6a1b6802d h1:pUSEBYeASep5mmhgY5ZgD6zz3TDJ4SWJwaepxO+tJog=
|
golang.org/x/tools v0.0.0-20200312153518-5e2df02acb1e h1:bQaoCUKSo4FqzkHQQxNMOY9NXAZm/8d11bD7PGEzOfE=
|
||||||
golang.org/x/tools v0.0.0-20200226180945-26f6a1b6802d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200312153518-5e2df02acb1e/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||||
|
2
vendor/golang.org/x/tools/cmd/goimports/goimports.go
generated
vendored
2
vendor/golang.org/x/tools/cmd/goimports/goimports.go
generated
vendored
@ -262,7 +262,7 @@ func gofmtMain() {
|
|||||||
|
|
||||||
if verbose {
|
if verbose {
|
||||||
log.SetFlags(log.LstdFlags | log.Lmicroseconds)
|
log.SetFlags(log.LstdFlags | log.Lmicroseconds)
|
||||||
options.Env.Debug = true
|
options.Env.Logf = log.Printf
|
||||||
}
|
}
|
||||||
if options.TabWidth < 0 {
|
if options.TabWidth < 0 {
|
||||||
fmt.Fprintf(os.Stderr, "negative tabwidth %d\n", options.TabWidth)
|
fmt.Fprintf(os.Stderr, "negative tabwidth %d\n", options.TabWidth)
|
||||||
|
5
vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go
generated
vendored
5
vendor/golang.org/x/tools/internal/fastwalk/fastwalk_unix.go
generated
vendored
@ -76,8 +76,9 @@ func readDir(dirName string, fn func(dirName, entName string, typ os.FileMode) e
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) {
|
func parseDirEnt(buf []byte) (consumed int, name string, typ os.FileMode) {
|
||||||
// golang.org/issue/15653
|
// golang.org/issue/37269
|
||||||
dirent := (*syscall.Dirent)(unsafe.Pointer(&buf[0]))
|
dirent := &syscall.Dirent{}
|
||||||
|
copy((*[unsafe.Sizeof(syscall.Dirent{})]byte)(unsafe.Pointer(dirent))[:], buf)
|
||||||
if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v {
|
if v := unsafe.Offsetof(dirent.Reclen) + unsafe.Sizeof(dirent.Reclen); uintptr(len(buf)) < v {
|
||||||
panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v))
|
panic(fmt.Sprintf("buf size of %d smaller than dirent header size %d", len(buf), v))
|
||||||
}
|
}
|
||||||
|
32
vendor/golang.org/x/tools/internal/gopathwalk/walk.go
generated
vendored
32
vendor/golang.org/x/tools/internal/gopathwalk/walk.go
generated
vendored
@ -23,8 +23,10 @@ import (
|
|||||||
|
|
||||||
// Options controls the behavior of a Walk call.
|
// Options controls the behavior of a Walk call.
|
||||||
type Options struct {
|
type Options struct {
|
||||||
Debug bool // Enable debug logging
|
// If Logf is non-nil, debug logging is enabled through this function.
|
||||||
ModulesEnabled bool // Search module caches. Also disables legacy goimports ignore rules.
|
Logf func(format string, args ...interface{})
|
||||||
|
// Search module caches. Also disables legacy goimports ignore rules.
|
||||||
|
ModulesEnabled bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// RootType indicates the type of a Root.
|
// RootType indicates the type of a Root.
|
||||||
@ -80,14 +82,14 @@ func WalkSkip(roots []Root, add func(root Root, dir string), skip func(root Root
|
|||||||
// walkDir creates a walker and starts fastwalk with this walker.
|
// walkDir creates a walker and starts fastwalk with this walker.
|
||||||
func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) {
|
func walkDir(root Root, add func(Root, string), skip func(root Root, dir string) bool, opts Options) {
|
||||||
if _, err := os.Stat(root.Path); os.IsNotExist(err) {
|
if _, err := os.Stat(root.Path); os.IsNotExist(err) {
|
||||||
if opts.Debug {
|
if opts.Logf != nil {
|
||||||
log.Printf("skipping nonexistent directory: %v", root.Path)
|
opts.Logf("skipping nonexistent directory: %v", root.Path)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
if opts.Debug {
|
if opts.Logf != nil {
|
||||||
log.Printf("gopathwalk: scanning %s", root.Path)
|
opts.Logf("gopathwalk: scanning %s", root.Path)
|
||||||
}
|
}
|
||||||
w := &walker{
|
w := &walker{
|
||||||
root: root,
|
root: root,
|
||||||
@ -100,8 +102,8 @@ func walkDir(root Root, add func(Root, string), skip func(root Root, dir string)
|
|||||||
log.Printf("gopathwalk: scanning directory %v: %v", root.Path, err)
|
log.Printf("gopathwalk: scanning directory %v: %v", root.Path, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.Debug {
|
if opts.Logf != nil {
|
||||||
log.Printf("gopathwalk: scanned %s in %v", root.Path, time.Since(start))
|
opts.Logf("gopathwalk: scanned %s in %v", root.Path, time.Since(start))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,11 +132,11 @@ func (w *walker) init() {
|
|||||||
full := filepath.Join(w.root.Path, p)
|
full := filepath.Join(w.root.Path, p)
|
||||||
if fi, err := os.Stat(full); err == nil {
|
if fi, err := os.Stat(full); err == nil {
|
||||||
w.ignoredDirs = append(w.ignoredDirs, fi)
|
w.ignoredDirs = append(w.ignoredDirs, fi)
|
||||||
if w.opts.Debug {
|
if w.opts.Logf != nil {
|
||||||
log.Printf("Directory added to ignore list: %s", full)
|
w.opts.Logf("Directory added to ignore list: %s", full)
|
||||||
}
|
}
|
||||||
} else if w.opts.Debug {
|
} else if w.opts.Logf != nil {
|
||||||
log.Printf("Error statting ignored directory: %v", err)
|
w.opts.Logf("Error statting ignored directory: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,11 +147,11 @@ func (w *walker) init() {
|
|||||||
func (w *walker) getIgnoredDirs(path string) []string {
|
func (w *walker) getIgnoredDirs(path string) []string {
|
||||||
file := filepath.Join(path, ".goimportsignore")
|
file := filepath.Join(path, ".goimportsignore")
|
||||||
slurp, err := ioutil.ReadFile(file)
|
slurp, err := ioutil.ReadFile(file)
|
||||||
if w.opts.Debug {
|
if w.opts.Logf != nil {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Print(err)
|
w.opts.Logf("%v", err)
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Read %s", file)
|
w.opts.Logf("Read %s", file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
19
vendor/golang.org/x/tools/internal/imports/fix.go
generated
vendored
19
vendor/golang.org/x/tools/internal/imports/fix.go
generated
vendored
@ -262,7 +262,7 @@ type pass struct {
|
|||||||
|
|
||||||
// loadPackageNames saves the package names for everything referenced by imports.
|
// loadPackageNames saves the package names for everything referenced by imports.
|
||||||
func (p *pass) loadPackageNames(imports []*ImportInfo) error {
|
func (p *pass) loadPackageNames(imports []*ImportInfo) error {
|
||||||
if p.env.Debug {
|
if p.env.Logf != nil {
|
||||||
p.env.Logf("loading package names for %v packages", len(imports))
|
p.env.Logf("loading package names for %v packages", len(imports))
|
||||||
defer func() {
|
defer func() {
|
||||||
p.env.Logf("done loading package names for %v packages", len(imports))
|
p.env.Logf("done loading package names for %v packages", len(imports))
|
||||||
@ -334,7 +334,7 @@ func (p *pass) load() ([]*ImportFix, bool) {
|
|||||||
if p.loadRealPackageNames {
|
if p.loadRealPackageNames {
|
||||||
err := p.loadPackageNames(append(imports, p.candidates...))
|
err := p.loadPackageNames(append(imports, p.candidates...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if p.env.Debug {
|
if p.env.Logf != nil {
|
||||||
p.env.Logf("loading package names: %v", err)
|
p.env.Logf("loading package names: %v", err)
|
||||||
}
|
}
|
||||||
return nil, false
|
return nil, false
|
||||||
@ -528,7 +528,7 @@ func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
srcDir := filepath.Dir(abs)
|
srcDir := filepath.Dir(abs)
|
||||||
if env.Debug {
|
if env.Logf != nil {
|
||||||
env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir)
|
env.Logf("fixImports(filename=%q), abs=%q, srcDir=%q ...", filename, abs, srcDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -746,7 +746,6 @@ func getPackageExports(ctx context.Context, wrapped func(PackageExport), searchP
|
|||||||
// the go command, the go/build package, etc.
|
// the go command, the go/build package, etc.
|
||||||
type ProcessEnv struct {
|
type ProcessEnv struct {
|
||||||
LocalPrefix string
|
LocalPrefix string
|
||||||
Debug bool
|
|
||||||
|
|
||||||
BuildFlags []string
|
BuildFlags []string
|
||||||
|
|
||||||
@ -755,7 +754,7 @@ type ProcessEnv struct {
|
|||||||
GOPATH, GOROOT, GO111MODULE, GOPROXY, GOFLAGS, GOSUMDB string
|
GOPATH, GOROOT, GO111MODULE, GOPROXY, GOFLAGS, GOSUMDB string
|
||||||
WorkingDir string
|
WorkingDir string
|
||||||
|
|
||||||
// Logf is the default logger for the ProcessEnv.
|
// If Logf is non-nil, debug logging is enabled through this function.
|
||||||
Logf func(format string, args ...interface{})
|
Logf func(format string, args ...interface{})
|
||||||
|
|
||||||
resolver Resolver
|
resolver Resolver
|
||||||
@ -1238,7 +1237,7 @@ func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error
|
|||||||
case <-r.scanSema:
|
case <-r.scanSema:
|
||||||
}
|
}
|
||||||
defer func() { r.scanSema <- struct{}{} }()
|
defer func() { r.scanSema <- struct{}{} }()
|
||||||
gopathwalk.Walk(roots, add, gopathwalk.Options{Debug: r.env.Debug, ModulesEnabled: false})
|
gopathwalk.Walk(roots, add, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: false})
|
||||||
close(scanDone)
|
close(scanDone)
|
||||||
}()
|
}()
|
||||||
select {
|
select {
|
||||||
@ -1342,7 +1341,7 @@ func loadExportsFromFiles(ctx context.Context, env *ProcessEnv, dir string, incl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if env.Debug {
|
if env.Logf != nil {
|
||||||
sortedExports := append([]string(nil), exports...)
|
sortedExports := append([]string(nil), exports...)
|
||||||
sort.Strings(sortedExports)
|
sort.Strings(sortedExports)
|
||||||
env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", "))
|
env.Logf("loaded exports in dir %v (package %v): %v", dir, pkgName, strings.Join(sortedExports, ", "))
|
||||||
@ -1358,7 +1357,7 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa
|
|||||||
// ones. Note that this sorts by the de-vendored name, so
|
// ones. Note that this sorts by the de-vendored name, so
|
||||||
// there's no "penalty" for vendoring.
|
// there's no "penalty" for vendoring.
|
||||||
sort.Sort(byDistanceOrImportPathShortLength(candidates))
|
sort.Sort(byDistanceOrImportPathShortLength(candidates))
|
||||||
if pass.env.Debug {
|
if pass.env.Logf != nil {
|
||||||
for i, c := range candidates {
|
for i, c := range candidates {
|
||||||
pass.env.Logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir)
|
pass.env.Logf("%s candidate %d/%d: %v in %v", pkgName, i+1, len(candidates), c.pkg.importPathShort, c.pkg.dir)
|
||||||
}
|
}
|
||||||
@ -1396,14 +1395,14 @@ func findImport(ctx context.Context, pass *pass, candidates []pkgDistance, pkgNa
|
|||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if pass.env.Debug {
|
if pass.env.Logf != nil {
|
||||||
pass.env.Logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName)
|
pass.env.Logf("loading exports in dir %s (seeking package %s)", c.pkg.dir, pkgName)
|
||||||
}
|
}
|
||||||
// If we're an x_test, load the package under test's test variant.
|
// If we're an x_test, load the package under test's test variant.
|
||||||
includeTest := strings.HasSuffix(pass.f.Name.Name, "_test") && c.pkg.dir == pass.srcDir
|
includeTest := strings.HasSuffix(pass.f.Name.Name, "_test") && c.pkg.dir == pass.srcDir
|
||||||
_, exports, err := pass.env.GetResolver().loadExports(ctx, c.pkg, includeTest)
|
_, exports, err := pass.env.GetResolver().loadExports(ctx, c.pkg, includeTest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if pass.env.Debug {
|
if pass.env.Logf != nil {
|
||||||
pass.env.Logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err)
|
pass.env.Logf("loading exports in dir %s (seeking package %s): %v", c.pkg.dir, pkgName, err)
|
||||||
}
|
}
|
||||||
resc <- nil
|
resc <- nil
|
||||||
|
7
vendor/golang.org/x/tools/internal/imports/imports.go
generated
vendored
7
vendor/golang.org/x/tools/internal/imports/imports.go
generated
vendored
@ -21,7 +21,6 @@ import (
|
|||||||
"go/token"
|
"go/token"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -155,12 +154,6 @@ func initialize(filename string, src []byte, opt *Options) ([]byte, *Options, er
|
|||||||
GOSUMDB: os.Getenv("GOSUMDB"),
|
GOSUMDB: os.Getenv("GOSUMDB"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the logger if the user has not provided it.
|
|
||||||
if opt.Env.Logf == nil {
|
|
||||||
opt.Env.Logf = log.Printf
|
|
||||||
}
|
|
||||||
|
|
||||||
if src == nil {
|
if src == nil {
|
||||||
b, err := ioutil.ReadFile(filename)
|
b, err := ioutil.ReadFile(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
6
vendor/golang.org/x/tools/internal/imports/mod.go
generated
vendored
6
vendor/golang.org/x/tools/internal/imports/mod.go
generated
vendored
@ -156,7 +156,7 @@ func (r *ModuleResolver) initAllMods() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if mod.Dir == "" {
|
if mod.Dir == "" {
|
||||||
if r.env.Debug {
|
if r.env.Logf != nil {
|
||||||
r.env.Logf("module %v has not been downloaded and will be ignored", mod.Path)
|
r.env.Logf("module %v has not been downloaded and will be ignored", mod.Path)
|
||||||
}
|
}
|
||||||
// Can't do anything with a module that's not downloaded.
|
// Can't do anything with a module that's not downloaded.
|
||||||
@ -470,7 +470,7 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error
|
|||||||
if r.scannedRoots[root] {
|
if r.scannedRoots[root] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Debug: r.env.Debug, ModulesEnabled: true})
|
gopathwalk.WalkSkip([]gopathwalk.Root{root}, add, skip, gopathwalk.Options{Logf: r.env.Logf, ModulesEnabled: true})
|
||||||
r.scannedRoots[root] = true
|
r.scannedRoots[root] = true
|
||||||
}
|
}
|
||||||
close(scanDone)
|
close(scanDone)
|
||||||
@ -583,7 +583,7 @@ func (r *ModuleResolver) scanDirForPackage(root gopathwalk.Root, dir string) dir
|
|||||||
}
|
}
|
||||||
modPath, err := module.UnescapePath(filepath.ToSlash(matches[1]))
|
modPath, err := module.UnescapePath(filepath.ToSlash(matches[1]))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if r.env.Debug {
|
if r.env.Logf != nil {
|
||||||
r.env.Logf("decoding module cache path %q: %v", subdir, err)
|
r.env.Logf("decoding module cache path %q: %v", subdir, err)
|
||||||
}
|
}
|
||||||
return directoryPackageInfo{
|
return directoryPackageInfo{
|
||||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -159,7 +159,7 @@ golang.org/x/text/secure/bidirule
|
|||||||
golang.org/x/text/transform
|
golang.org/x/text/transform
|
||||||
golang.org/x/text/unicode/bidi
|
golang.org/x/text/unicode/bidi
|
||||||
golang.org/x/text/unicode/norm
|
golang.org/x/text/unicode/norm
|
||||||
# golang.org/x/tools v0.0.0-20200226180945-26f6a1b6802d
|
# golang.org/x/tools v0.0.0-20200312153518-5e2df02acb1e
|
||||||
golang.org/x/tools/cmd/goimports
|
golang.org/x/tools/cmd/goimports
|
||||||
golang.org/x/tools/go/analysis
|
golang.org/x/tools/go/analysis
|
||||||
golang.org/x/tools/go/analysis/passes/inspect
|
golang.org/x/tools/go/analysis/passes/inspect
|
||||||
|
Loading…
Reference in New Issue
Block a user