Commit 27e50a1a authored by Jay Conrod's avatar Jay Conrod

cmd: update golang.org/x/mod and vendor

This CL pulls in a fix to golang.org/x/mod/modfile. No change needed
to cmd/go.

Fixes #35737

Change-Id: I7ca1bb46d2923b01587042f0f312d3c3df54c425
Reviewed-on: https://go-review.googlesource.com/c/go/+/208977
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: default avatarBryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 67f0f832
...@@ -7,7 +7,7 @@ require ( ...@@ -7,7 +7,7 @@ require (
github.com/ianlancetaylor/demangle v0.0.0-20180524225900-fc6590592b44 // indirect github.com/ianlancetaylor/demangle v0.0.0-20180524225900-fc6590592b44 // indirect
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1 golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee golang.org/x/mod v0.1.1-0.20191126161957-788aebd06792
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect
golang.org/x/tools v0.0.0-20191104222624-6b7b8b79ae80 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e
) )
...@@ -7,8 +7,8 @@ golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1/go.mod h1:flIaEI6LNU6xOCD5P ...@@ -7,8 +7,8 @@ golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1/go.mod h1:flIaEI6LNU6xOCD5P
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.1.1-0.20191126161957-788aebd06792 h1:04Uqz7R2BD7irAGgQtrKNW5tLa50RgSW71y4ofoaivk=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191126161957-788aebd06792/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
...@@ -18,8 +18,8 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dz ...@@ -18,8 +18,8 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dz
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20191104222624-6b7b8b79ae80 h1:6CcDC1SXj4DrJP955osT9RJmKsH3LQBZJ59D5v4Rw0s= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e h1:aZzprAO9/8oim3qStq3wc1Xuxx4QmAGriC4VU4ojemQ=
golang.org/x/tools v0.0.0-20191104222624-6b7b8b79ae80/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
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 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
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=
......
...@@ -313,8 +313,8 @@ func isIndirect(line *Line) bool { ...@@ -313,8 +313,8 @@ func isIndirect(line *Line) bool {
if len(line.Suffix) == 0 { if len(line.Suffix) == 0 {
return false return false
} }
f := strings.Fields(line.Suffix[0].Token) f := strings.Fields(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash)))
return (len(f) == 2 && f[1] == "indirect" || len(f) > 2 && f[1] == "indirect;") && f[0] == "//" return (len(f) == 1 && f[0] == "indirect" || len(f) > 1 && f[0] == "indirect;")
} }
// setIndirect sets line to have (or not have) a "// indirect" comment. // setIndirect sets line to have (or not have) a "// indirect" comment.
...@@ -329,13 +329,17 @@ func setIndirect(line *Line, indirect bool) { ...@@ -329,13 +329,17 @@ func setIndirect(line *Line, indirect bool) {
line.Suffix = []Comment{{Token: "// indirect", Suffix: true}} line.Suffix = []Comment{{Token: "// indirect", Suffix: true}}
return return
} }
// Insert at beginning of existing comment.
com := &line.Suffix[0] com := &line.Suffix[0]
space := " " text := strings.TrimSpace(strings.TrimPrefix(com.Token, string(slashSlash)))
if len(com.Token) > 2 && com.Token[2] == ' ' || com.Token[2] == '\t' { if text == "" {
space = "" // Empty comment.
com.Token = "// indirect"
return
} }
com.Token = "// indirect;" + space + com.Token[2:]
// Insert at beginning of existing comment.
com.Token = "// indirect; " + text
return return
} }
......
...@@ -123,8 +123,12 @@ type Version struct { ...@@ -123,8 +123,12 @@ type Version struct {
Version string `json:",omitempty"` Version string `json:",omitempty"`
} }
// String returns the module version syntax Path@Version. // String returns a representation of the Version suitable for logging
// (Path@Version, or just Path if Version is empty).
func (m Version) String() string { func (m Version) String() string {
if m.Version == "" {
return m.Path
}
return m.Path + "@" + m.Version return m.Path + "@" + m.Version
} }
......
...@@ -234,6 +234,8 @@ func Create(w io.Writer, m module.Version, files []File) (err error) { ...@@ -234,6 +234,8 @@ func Create(w io.Writer, m module.Version, files []File) (err error) {
// belong in the module zip. In particular, CreateFromDir will not include // belong in the module zip. In particular, CreateFromDir will not include
// files in modules found in subdirectories, most files in vendor directories, // files in modules found in subdirectories, most files in vendor directories,
// or irregular files (such as symbolic links) in the output archive. // or irregular files (such as symbolic links) in the output archive.
// Additionally, unlike Create, CreateFromDir will not include directories
// named ".bzr", ".git", ".hg", or ".svn".
func CreateFromDir(w io.Writer, m module.Version, dir string) (err error) { func CreateFromDir(w io.Writer, m module.Version, dir string) (err error) {
defer func() { defer func() {
if zerr, ok := err.(*zipError); ok { if zerr, ok := err.(*zipError); ok {
...@@ -257,6 +259,14 @@ func CreateFromDir(w io.Writer, m module.Version, dir string) (err error) { ...@@ -257,6 +259,14 @@ func CreateFromDir(w io.Writer, m module.Version, dir string) (err error) {
return nil return nil
} }
// Skip VCS directories.
// fossil repos are regular files with arbitrary names, so we don't try
// to exclude them.
switch filepath.Base(filePath) {
case ".bzr", ".git", ".hg", ".svn":
return filepath.SkipDir
}
// Skip some subdirectories inside vendor, but maintain bug // Skip some subdirectories inside vendor, but maintain bug
// golang.org/issue/31562, described in isVendoredPackage. // golang.org/issue/31562, described in isVendoredPackage.
// We would like Create and CreateFromDir to produce the same result // We would like Create and CreateFromDir to produce the same result
......
...@@ -22,9 +22,11 @@ import ( ...@@ -22,9 +22,11 @@ import (
"golang.org/x/tools/go/analysis/passes/internal/analysisutil" "golang.org/x/tools/go/analysis/passes/internal/analysisutil"
) )
const Doc = "report mismatches between assembly files and Go declarations"
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "asmdecl", Name: "asmdecl",
Doc: "report mismatches between assembly files and Go declarations", Doc: Doc,
Run: run, Run: run,
} }
......
...@@ -17,9 +17,11 @@ import ( ...@@ -17,9 +17,11 @@ import (
"golang.org/x/tools/go/ast/inspector" "golang.org/x/tools/go/ast/inspector"
) )
const Doc = "check for common mistakes involving boolean operators"
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "bools", Name: "bools",
Doc: "check for common mistakes involving boolean operators", Doc: Doc,
Requires: []*analysis.Analyzer{inspect.Analyzer}, Requires: []*analysis.Analyzer{inspect.Analyzer},
Run: run, Run: run,
} }
......
...@@ -16,9 +16,11 @@ import ( ...@@ -16,9 +16,11 @@ import (
"golang.org/x/tools/go/analysis/passes/internal/analysisutil" "golang.org/x/tools/go/analysis/passes/internal/analysisutil"
) )
const Doc = "check that +build tags are well-formed and correctly located"
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "buildtag", Name: "buildtag",
Doc: "check that +build tags are well-formed and correctly located", Doc: Doc,
Run: runBuildTag, Run: runBuildTag,
} }
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
const debug = false const debug = false
const doc = `detect some violations of the cgo pointer passing rules const Doc = `detect some violations of the cgo pointer passing rules
Check for invalid cgo pointer passing. Check for invalid cgo pointer passing.
This looks for code that uses cgo to call C code passing values This looks for code that uses cgo to call C code passing values
...@@ -34,7 +34,7 @@ or slice to C, either directly, or via a pointer, array, or struct.` ...@@ -34,7 +34,7 @@ or slice to C, either directly, or via a pointer, array, or struct.`
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "cgocall", Name: "cgocall",
Doc: doc, Doc: Doc,
RunDespiteErrors: true, RunDespiteErrors: true,
Run: run, Run: run,
} }
......
...@@ -16,14 +16,14 @@ import ( ...@@ -16,14 +16,14 @@ import (
"golang.org/x/tools/go/types/typeutil" "golang.org/x/tools/go/types/typeutil"
) )
const doc = `report passing non-pointer or non-error values to errors.As const Doc = `report passing non-pointer or non-error values to errors.As
The errorsas analysis reports calls to errors.As where the type The errorsas analysis reports calls to errors.As where the type
of the second argument is not a pointer to a type implementing error.` of the second argument is not a pointer to a type implementing error.`
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "errorsas", Name: "errorsas",
Doc: doc, Doc: Doc,
Requires: []*analysis.Analyzer{inspect.Analyzer}, Requires: []*analysis.Analyzer{inspect.Analyzer},
Run: run, Run: run,
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// Package lostcancel defines an Analyzer that checks for failure to // Package lostcancel defines an Analyzer that checks for failure to
// call a context cancelation function. // call a context cancellation function.
package lostcancel package lostcancel
import ( import (
...@@ -20,7 +20,7 @@ import ( ...@@ -20,7 +20,7 @@ import (
const Doc = `check cancel func returned by context.WithCancel is called const Doc = `check cancel func returned by context.WithCancel is called
The cancelation function returned by context.WithCancel, WithTimeout, The cancellation function returned by context.WithCancel, WithTimeout,
and WithDeadline must be called or the new context will remain live and WithDeadline must be called or the new context will remain live
until its parent context is cancelled. until its parent context is cancelled.
(The background context is never cancelled.)` (The background context is never cancelled.)`
......
...@@ -33,14 +33,14 @@ func init() { ...@@ -33,14 +33,14 @@ func init() {
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "printf", Name: "printf",
Doc: doc, Doc: Doc,
Requires: []*analysis.Analyzer{inspect.Analyzer}, Requires: []*analysis.Analyzer{inspect.Analyzer},
Run: run, Run: run,
ResultType: reflect.TypeOf((*Result)(nil)), ResultType: reflect.TypeOf((*Result)(nil)),
FactTypes: []analysis.Fact{new(isWrapper)}, FactTypes: []analysis.Fact{new(isWrapper)},
} }
const doc = `check consistency of Printf format strings and arguments const Doc = `check consistency of Printf format strings and arguments
The check applies to known functions (for example, those in package fmt) The check applies to known functions (for example, those in package fmt)
as well as any detected wrappers of known functions. as well as any detected wrappers of known functions.
......
...@@ -21,9 +21,11 @@ import ( ...@@ -21,9 +21,11 @@ import (
"golang.org/x/tools/go/ast/inspector" "golang.org/x/tools/go/ast/inspector"
) )
const Doc = "check for shifts that equal or exceed the width of the integer"
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "shift", Name: "shift",
Doc: "check for shifts that equal or exceed the width of the integer", Doc: Doc,
Requires: []*analysis.Analyzer{inspect.Analyzer}, Requires: []*analysis.Analyzer{inspect.Analyzer},
Run: run, Run: run,
} }
......
...@@ -16,14 +16,14 @@ import ( ...@@ -16,14 +16,14 @@ import (
"golang.org/x/tools/go/types/typeutil" "golang.org/x/tools/go/types/typeutil"
) )
const doc = `report passing non-pointer or non-interface values to unmarshal const Doc = `report passing non-pointer or non-interface values to unmarshal
The unmarshal analysis reports calls to functions such as json.Unmarshal The unmarshal analysis reports calls to functions such as json.Unmarshal
in which the argument type is not a pointer or an interface.` in which the argument type is not a pointer or an interface.`
var Analyzer = &analysis.Analyzer{ var Analyzer = &analysis.Analyzer{
Name: "unmarshal", Name: "unmarshal",
Doc: doc, Doc: Doc,
Requires: []*analysis.Analyzer{inspect.Analyzer}, Requires: []*analysis.Analyzer{inspect.Analyzer},
Run: run, Run: run,
} }
......
...@@ -29,7 +29,7 @@ golang.org/x/arch/x86/x86asm ...@@ -29,7 +29,7 @@ golang.org/x/arch/x86/x86asm
golang.org/x/crypto/ed25519 golang.org/x/crypto/ed25519
golang.org/x/crypto/ed25519/internal/edwards25519 golang.org/x/crypto/ed25519/internal/edwards25519
golang.org/x/crypto/ssh/terminal golang.org/x/crypto/ssh/terminal
# golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee # golang.org/x/mod v0.1.1-0.20191126161957-788aebd06792
## explicit ## explicit
golang.org/x/mod/internal/lazyregexp golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/modfile golang.org/x/mod/modfile
...@@ -44,7 +44,7 @@ golang.org/x/mod/zip ...@@ -44,7 +44,7 @@ golang.org/x/mod/zip
## explicit ## explicit
golang.org/x/sys/unix golang.org/x/sys/unix
golang.org/x/sys/windows golang.org/x/sys/windows
# golang.org/x/tools v0.0.0-20191104222624-6b7b8b79ae80 # golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e
## explicit ## explicit
golang.org/x/tools/go/analysis golang.org/x/tools/go/analysis
golang.org/x/tools/go/analysis/internal/analysisflags golang.org/x/tools/go/analysis/internal/analysisflags
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment