]> Cypherpunks repositories - gostls13.git/commitdiff
cmd: update golang.org/x/tools to 3b9d20c52192
authorTim King <taking@google.com>
Mon, 21 Nov 2022 22:09:35 +0000 (14:09 -0800)
committerTim King <taking@google.com>
Mon, 21 Nov 2022 22:49:25 +0000 (22:49 +0000)
To pick up CL 452155.

Done by
        go get -d golang.org/x/tools@master
        go mod tidy
        go mod vendor

Change-Id: I4dba4ba9f17123cfe567704b0d5e5fc16f9ffd83
Reviewed-on: https://go-review.googlesource.com/c/go/+/452615
Run-TryBot: Tim King <taking@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/go.mod
src/cmd/go.sum
src/cmd/vendor/golang.org/x/tools/go/analysis/analysis.go
src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go
src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go
src/cmd/vendor/golang.org/x/tools/internal/analysisinternal/analysis.go
src/cmd/vendor/modules.txt

index 73bbec1de0eb6908ad29e5069d797f0a9c00af7c..3b199ef54b4da621000675b51e462483f9b58189 100644 (file)
@@ -9,7 +9,7 @@ require (
        golang.org/x/sync v0.1.0
        golang.org/x/sys v0.2.0
        golang.org/x/term v0.1.0
-       golang.org/x/tools v0.3.0
+       golang.org/x/tools v0.3.1-0.20221121204139-3b9d20c52192
 )
 
 require github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2 // indirect
index 29538553bbb2adf636660d44c81b4eba5d3b5306..b0e04ce9136f597c1e2033773009b7bc4a6f11c2 100644 (file)
@@ -12,5 +12,5 @@ golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
 golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
 golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
-golang.org/x/tools v0.3.0 h1:SrNbZl6ECOS1qFzgTdQfWXZM9XBkiA6tkFrH9YSTPHM=
-golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
+golang.org/x/tools v0.3.1-0.20221121204139-3b9d20c52192 h1:WKkUAWH1gBo+5k1/MzaZPmDNYJP+fwpZUVn6dXGC1Vo=
+golang.org/x/tools v0.3.1-0.20221121204139-3b9d20c52192/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
index d11505a165c86ee7b56f902cbcc74a5cb8f3f5a3..44ada22a03a41932da918112458818a05ac28f16 100644 (file)
@@ -11,8 +11,6 @@ import (
        "go/token"
        "go/types"
        "reflect"
-
-       "golang.org/x/tools/internal/analysisinternal"
 )
 
 // An Analyzer describes an analysis function and its options.
@@ -48,6 +46,7 @@ type Analyzer struct {
        // RunDespiteErrors allows the driver to invoke
        // the Run method of this analyzer even on a
        // package that contains parse or type errors.
+       // The Pass.TypeErrors field may consequently be non-empty.
        RunDespiteErrors bool
 
        // Requires is a set of analyzers that must run successfully
@@ -75,17 +74,6 @@ type Analyzer struct {
 
 func (a *Analyzer) String() string { return a.Name }
 
-func init() {
-       // Set the analysisinternal functions to be able to pass type errors
-       // to the Pass type without modifying the go/analysis API.
-       analysisinternal.SetTypeErrors = func(p interface{}, errors []types.Error) {
-               p.(*Pass).typeErrors = errors
-       }
-       analysisinternal.GetTypeErrors = func(p interface{}) []types.Error {
-               return p.(*Pass).typeErrors
-       }
-}
-
 // A Pass provides information to the Run function that
 // applies a specific analyzer to a single Go package.
 //
@@ -106,6 +94,7 @@ type Pass struct {
        Pkg          *types.Package // type information about the package
        TypesInfo    *types.Info    // type information about the syntax trees
        TypesSizes   types.Sizes    // function for computing sizes of types
+       TypeErrors   []types.Error  // type errors (only if Analyzer.RunDespiteErrors)
 
        // Report reports a Diagnostic, a finding about a specific location
        // in the analyzed source code such as a potential mistake.
index 2c49e33589205ab1a2843eb1f2ed42cc4f859d64..b5a301c205ea06076e126ede1f65f1e186050f57 100644 (file)
@@ -297,7 +297,7 @@ singlechecker and multichecker subpackages.
 
 The singlechecker package provides the main function for a command that
 runs one analyzer. By convention, each analyzer such as
-go/passes/findcall should be accompanied by a singlechecker-based
+go/analysis/passes/findcall should be accompanied by a singlechecker-based
 command such as go/analysis/passes/findcall/cmd/findcall, defined in its
 entirety as:
 
index d9c8f11cdd461278ea31fc96191b06564622e3d5..6e6907d261f1a2f0a4edbacf53f919ad7cee80d1 100644 (file)
@@ -340,6 +340,7 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re
                                Pkg:               pkg,
                                TypesInfo:         info,
                                TypesSizes:        tc.Sizes,
+                               TypeErrors:        nil, // unitchecker doesn't RunDespiteErrors
                                ResultOf:          inputs,
                                Report:            func(d analysis.Diagnostic) { act.diagnostics = append(act.diagnostics, d) },
                                ImportObjectFact:  facts.ImportObjectFact,
index 6fceef5e7200ebf2847698a8f64e5601e58536c4..d15f0eb7abf250c0f0cb8d86dd2322128ee53d13 100644 (file)
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package analysisinternal exposes internal-only fields from go/analysis.
+// Package analysisinternal provides gopls' internal analyses with a
+// number of helper functions that operate on typed syntax trees.
 package analysisinternal
 
 import (
@@ -18,11 +19,6 @@ import (
 // in Go 1.18+.
 var DiagnoseFuzzTests bool = false
 
-var (
-       GetTypeErrors func(p interface{}) []types.Error
-       SetTypeErrors func(p interface{}, errors []types.Error)
-)
-
 func TypeErrorEndPos(fset *token.FileSet, src []byte, start token.Pos) token.Pos {
        // Get the end position for the type error.
        offset, end := fset.PositionFor(start, false).Offset, start
@@ -210,14 +206,6 @@ func TypeExpr(f *ast.File, pkg *types.Package, typ types.Type) ast.Expr {
        }
 }
 
-type TypeErrorPass string
-
-const (
-       NoNewVars      TypeErrorPass = "nonewvars"
-       NoResultValues TypeErrorPass = "noresultvalues"
-       UndeclaredName TypeErrorPass = "undeclaredname"
-)
-
 // StmtToInsertVarBefore returns the ast.Stmt before which we can safely insert a new variable.
 // Some examples:
 //
index a746c4f1dd310a0603e9b79a467de9cb770963b8..b090daf0ff7388521a594e071a7cf58cc866c22e 100644 (file)
@@ -46,7 +46,7 @@ golang.org/x/sys/windows
 # golang.org/x/term v0.1.0
 ## explicit; go 1.17
 golang.org/x/term
-# golang.org/x/tools v0.3.0
+# golang.org/x/tools v0.3.1-0.20221121204139-3b9d20c52192
 ## explicit; go 1.18
 golang.org/x/tools/cover
 golang.org/x/tools/go/analysis