diff --git a/DEPS.bzl b/DEPS.bzl index 192b89ab3c5b..f443151097d0 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -24,10 +24,10 @@ def go_deps(): name = "co_honnef_go_tools", build_file_proto_mode = "disable_global", importpath = "honnef.co/go/tools", - sha256 = "92c8ca92b043f42a62c4fe9d3856a99234ce39800420ed1fa813cb6b73fc3988", - strip_prefix = "honnef.co/go/tools@v0.0.1-2020.1.6", + sha256 = "b327a6e9565db3b835f2b224b9023f5dd9fb236e94285f002f0ac740ad2ac43b", + strip_prefix = "honnef.co/go/tools@v0.2.1", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.0.1-2020.1.6.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/honnef.co/go/tools/co_honnef_go_tools-v0.2.1.zip", ], ) go_repository( @@ -834,10 +834,10 @@ def go_deps(): name = "com_github_burntsushi_toml", build_file_proto_mode = "disable_global", importpath = "github.com/BurntSushi/toml", - sha256 = "815c6e594745f2d8842ff9a4b0569c6695e6cdfd5e07e5b3d98d06b72ca41e3c", - strip_prefix = "github.com/BurntSushi/toml@v0.3.1", + sha256 = "3f2cf2328cdfac39db5ae69c84201f961b50d15792f77de0abe87089836a932c", + strip_prefix = "github.com/BurntSushi/toml@v0.4.1", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v0.3.1.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/BurntSushi/toml/com_github_burntsushi_toml-v0.4.1.zip", ], ) go_repository( @@ -7504,10 +7504,10 @@ def go_deps(): name = "com_github_yuin_goldmark", build_file_proto_mode = "disable_global", importpath = "github.com/yuin/goldmark", - sha256 = "299f379635fab18f4a9681c37002dc66727049a41a68f19b79f9e6a604f71e09", - strip_prefix = "github.com/yuin/goldmark@v1.3.5", + sha256 = "920012ef5c68245bc8477f4c8bbc79264032fb6d17035f06bc4c9955f9d7f6c2", + strip_prefix = "github.com/yuin/goldmark@v1.4.0", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/yuin/goldmark/com_github_yuin_goldmark-v1.3.5.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/github.com/yuin/goldmark/com_github_yuin_goldmark-v1.4.0.zip", ], ) go_repository( @@ -8542,10 +8542,10 @@ def go_deps(): name = "org_golang_x_mod", build_file_proto_mode = "disable_global", importpath = "golang.org/x/mod", - sha256 = "39bc9b1570666300ba5c86244621ffbcc63b007ce69e6b7a46ffba7691929621", - strip_prefix = "golang.org/x/mod@v0.4.2", + sha256 = "8bed1489120e9428a64aca97c3a0d13065a33d1564593aae45e5c731c488f975", + strip_prefix = "golang.org/x/mod@v0.5.1", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/mod/org_golang_x_mod-v0.4.2.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/mod/org_golang_x_mod-v0.5.1.zip", ], ) go_repository( @@ -8592,10 +8592,10 @@ def go_deps(): name = "org_golang_x_sys", build_file_proto_mode = "disable_global", importpath = "golang.org/x/sys", - sha256 = "d454a6e32347b3a0ecb61fafb7587040042277ef197fc87cab8f1ccea0af4a19", - strip_prefix = "golang.org/x/sys@v0.0.0-20211025201205-69cdffdb9359", + sha256 = "3d9fae90bb6a22f2fe9f25a8861ebf9284539762fe7f6b99bbba88cf2e22118e", + strip_prefix = "golang.org/x/sys@v0.0.0-20211102061401-a2f17f7b995c", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sys/org_golang_x_sys-v0.0.0-20211025201205-69cdffdb9359.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/sys/org_golang_x_sys-v0.0.0-20211102061401-a2f17f7b995c.zip", ], ) go_repository( @@ -8632,10 +8632,10 @@ def go_deps(): name = "org_golang_x_tools", build_file_proto_mode = "disable_global", importpath = "golang.org/x/tools", - sha256 = "ed4d85b0314249df4bc0d00f9f566348f3882e42b9c1319f7a85e0d5a37b705b", - strip_prefix = "golang.org/x/tools@v0.1.5", + sha256 = "8e77ec3ce863221e4871e6cb3f0f148cd9f1c956446b4325abe6ec55262229db", + strip_prefix = "golang.org/x/tools@v0.1.7", urls = [ - "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/org_golang_x_tools-v0.1.5.zip", + "https://storage.googleapis.com/cockroach-godeps/gomod/golang.org/x/tools/org_golang_x_tools-v0.1.7.zip", ], ) go_repository( diff --git a/go.mod b/go.mod index cc54689b66b1..7a59e6cc3df2 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/Azure/go-autorest/autorest v0.11.20 github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 github.com/Azure/go-autorest/autorest/to v0.4.0 - github.com/BurntSushi/toml v0.3.1 + github.com/BurntSushi/toml v0.4.1 github.com/DataDog/zstd v1.4.8 // indirect github.com/MichaelTJones/walk v0.0.0-20161122175330-4748e29d5718 github.com/PuerkitoBio/goquery v1.5.1 @@ -157,15 +157,16 @@ require ( golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 golang.org/x/exp v0.0.0-20210514180818-737f94c0881e golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 + golang.org/x/mod v0.5.1 // indirect golang.org/x/net v0.0.0-20210913180222-943fd674d43e golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 + golang.org/x/sys v0.0.0-20211102061401-a2f17f7b995c golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d golang.org/x/text v0.3.7 golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac - golang.org/x/tools v0.1.5 + golang.org/x/tools v0.1.7 google.golang.org/api v0.56.0 google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af google.golang.org/grpc v1.40.0 @@ -173,7 +174,7 @@ require ( google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b - honnef.co/go/tools v0.2.0 + honnef.co/go/tools v0.2.1 vitess.io/vitess v0.0.0-00010101000000-000000000000 ) @@ -310,7 +311,6 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.16.0 // indirect - golang.org/x/mod v0.4.2 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/ini.v1 v1.62.0 // indirect @@ -325,8 +325,6 @@ replace github.com/abourget/teamcity => github.com/cockroachdb/teamcity v0.0.0-2 // has been addressed. replace github.com/bufbuild/buf => github.com/cockroachdb/buf v0.42.2-0.20210706083726-883d34031660 -replace honnef.co/go/tools => honnef.co/go/tools v0.0.1-2020.1.6 - replace vitess.io/vitess => github.com/cockroachdb/vitess v0.0.0-20210218160543-54524729cc82 replace gopkg.in/yaml.v2 => github.com/cockroachdb/yaml v0.0.0-20210825132133-2d6955c8edbc diff --git a/go.sum b/go.sum index 9e740a70363f..8a4011579fa1 100644 --- a/go.sum +++ b/go.sum @@ -115,8 +115,9 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= +github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgbutil v0.0.0-20160919175755-f7c97cef3b4e/go.mod h1:uw9h2sd4WWHOPdJ13MQpwK5qYWKYDumDqxWWIknEQ+k= github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw= @@ -1959,6 +1960,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -2128,6 +2130,7 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -2136,8 +2139,9 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2208,6 +2212,7 @@ golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210913180222-943fd674d43e h1:+b/22bPvDYt4NPDcy4xAGCmON713ONAWFeY3Z7I3tR8= golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -2361,14 +2366,15 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211015200801-69063c4bb744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359 h1:2B5p2L5IfGiD7+b9BOoRMC6DgObAVZV+Fsp050NqXik= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211102061401-a2f17f7b995c h1:QOfDMdrf/UwlVR0UBq2Mpr58UzNtvgJRXA4BgPfFACs= +golang.org/x/sys v0.0.0-20211102061401-a2f17f7b995c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= @@ -2422,6 +2428,7 @@ golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624190245-7f2218787638/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -2440,6 +2447,7 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2461,7 +2469,6 @@ golang.org/x/tools v0.0.0-20200304024140-c4206d458c3f/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200422205258-72e4a01eba43/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -2489,8 +2496,9 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ= +golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2734,8 +2742,17 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81 gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -honnef.co/go/tools v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc= -honnef.co/go/tools v0.0.1-2020.1.6/go.mod h1:pyyisuGw24ruLjrr1ddx39WE0y9OooInRzEYLhQB2YY= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +honnef.co/go/tools v0.2.1 h1:/EPr//+UMMXwMTkXvCCoaJDq8cpjMO80Ou+L4PDo2mY= +honnef.co/go/tools v0.2.1/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0= k8s.io/api v0.17.5/go.mod h1:0zV5/ungglgy2Rlm3QK8fbxkXVs+BSJWpJP/+8gUVLY= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= diff --git a/pkg/cli/nodelocal.go b/pkg/cli/nodelocal.go index a1f93e887631..33fa7a6e6f2c 100644 --- a/pkg/cli/nodelocal.go +++ b/pkg/cli/nodelocal.go @@ -111,6 +111,7 @@ func uploadFile( if n > 0 { // TODO(adityamaru): Switch to StmtExecContext once the copyin driver // supports it. + //lint:ignore SA1019 DriverConn doesn't support go 1.8 API _, err = stmt.Exec([]driver.Value{string(send[:n])}) if err != nil { return err diff --git a/pkg/cli/userfile.go b/pkg/cli/userfile.go index 2f733290e3c0..f7e970d65f97 100644 --- a/pkg/cli/userfile.go +++ b/pkg/cli/userfile.go @@ -563,7 +563,7 @@ func renameUserFile( _, _ = ex.ExecContext(ctx, `ROLLBACK`, nil) } }() - + //lint:ignore SA1019 DriverConn doesn't support go 1.8 API _, err = stmt.Exec([]driver.Value{newFilename, oldFilename}) if err != nil { return err @@ -652,6 +652,7 @@ func uploadUserFile( if n > 0 { // TODO(adityamaru): Switch to StmtExecContext once the copyin driver // supports it. + //lint:ignore SA1019 DriverConn doesn't support go 1.8 API _, err = stmt.Exec([]driver.Value{string(send[:n])}) if err != nil { return "", err diff --git a/pkg/cmd/dev/datadriven_test.go b/pkg/cmd/dev/datadriven_test.go index 3822568dedee..02bb7d88a83c 100644 --- a/pkg/cmd/dev/datadriven_test.go +++ b/pkg/cmd/dev/datadriven_test.go @@ -105,7 +105,7 @@ func TestDataDriven(t *testing.T) { logs, err := ioutil.ReadAll(logger) require.NoError(t, err) - return fmt.Sprintf("%s", logs) + return string(logs) default: return fmt.Sprintf("unknown command: %s", d.Cmd) } diff --git a/pkg/cmd/roachtest/tests/libpq.go b/pkg/cmd/roachtest/tests/libpq.go index c3752be0be94..c8edf42eda3b 100644 --- a/pkg/cmd/roachtest/tests/libpq.go +++ b/pkg/cmd/roachtest/tests/libpq.go @@ -107,12 +107,12 @@ func registerLibPQ(r registry.Registry) { // Convert the output of go test -list into an list. tests := strings.Fields(string(buf)) var allowedTests []string + testListR, err := regexp.Compile(testListRegex) + require.NoError(t, err) for _, testName := range tests { // Ignore tests that do not match the test regex pattern. - matched, err := regexp.MatchString(testListRegex, testName) - require.NoError(t, err) - if !matched { + if !testListR.MatchString(testName) { continue } // If the test is part of ignoreList, do not run the test. diff --git a/pkg/geo/geomfn/angle.go b/pkg/geo/geomfn/angle.go index 36f1c5b9025f..5648b8b05dc3 100644 --- a/pkg/geo/geomfn/angle.go +++ b/pkg/geo/geomfn/angle.go @@ -105,6 +105,12 @@ func angleFromCoords(c1, c2, c3, c4 geom.Coord) *float64 { // We want the clockwise angle, not the smallest interior angle, so can't use cosine formula. angle := math.Atan2(-coordDet(a, b), coordDot(a, b)) // We want the angle in the interval [0,2π), while Atan2 returns [-π,π] + // + // NB: In Go, the literal -0.0 does not produce negative + // zero. However, since IEEE 754 requires that -0.0 == 0.0, + // this code is still correct and we use -0.0 here for + // semantic clarity. + //lint:ignore SA4026 -0.0 used here for clarity if angle == -0.0 { angle = 0.0 } else if angle < 0 { diff --git a/pkg/keys/printer.go b/pkg/keys/printer.go index 5f33e1d1491c..a96b3aba3481 100644 --- a/pkg/keys/printer.go +++ b/pkg/keys/printer.go @@ -662,7 +662,7 @@ func prettyPrintInternal(valDirs []encoding.Direction, key roachpb.Key, quoteRaw if quoteRawKeys { return fmt.Sprintf("%q", []byte(key)), false } - return fmt.Sprintf("%s", []byte(key)), false + return string(key), false } for _, k := range keyOfKeyDict { diff --git a/pkg/kv/kvserver/store_replica_btree.go b/pkg/kv/kvserver/store_replica_btree.go index 7d1a878daaaf..99e2a9044143 100644 --- a/pkg/kv/kvserver/store_replica_btree.go +++ b/pkg/kv/kvserver/store_replica_btree.go @@ -146,7 +146,7 @@ func (b *storeReplicaBTree) VisitKeyRange( // exclusive and the high end as inclusive. return b.descendLessOrEqual(ctx, endKey, func(ctx context.Context, it replicaOrPlaceholder) error { - if it.item.(rangeKeyItem).key().Equal(endKey) { + if it.item.key().Equal(endKey) { // Skip the range starting at endKey. return nil } diff --git a/pkg/spanconfig/spanconfigkvsubscriber/kvsubscriber.go b/pkg/spanconfig/spanconfigkvsubscriber/kvsubscriber.go index 94405b6fa495..c9e27df7f937 100644 --- a/pkg/spanconfig/spanconfigkvsubscriber/kvsubscriber.go +++ b/pkg/spanconfig/spanconfigkvsubscriber/kvsubscriber.go @@ -420,7 +420,7 @@ type handler struct { fn func(update roachpb.Span) } -func (h handler) invoke(update roachpb.Span) { +func (h *handler) invoke(update roachpb.Span) { if !h.initialized { h.fn(keys.EverythingSpan) h.initialized = true diff --git a/pkg/sql/colexec/partially_ordered_distinct.go b/pkg/sql/colexec/partially_ordered_distinct.go index cf3422a2aeb0..dc1bf3c83b65 100644 --- a/pkg/sql/colexec/partially_ordered_distinct.go +++ b/pkg/sql/colexec/partially_ordered_distinct.go @@ -61,7 +61,7 @@ func newPartiallyOrderedDistinct( distinct := NewUnorderedDistinct(allocator, chunkerOperator, distinctUnorderedCols, typs, nullsAreDistinct, errorOnDup) return &partiallyOrderedDistinct{ input: chunkerOperator, - distinct: distinct.(colexecop.ResettableOperator), + distinct: distinct, }, nil } diff --git a/pkg/sql/inverted/expression_test.go b/pkg/sql/inverted/expression_test.go index 7ff4938a97aa..20ef38901445 100644 --- a/pkg/sql/inverted/expression_test.go +++ b/pkg/sql/inverted/expression_test.go @@ -80,13 +80,13 @@ type UnknownExpression struct { tight bool } -func (u UnknownExpression) IsTight() bool { return u.tight } -func (u UnknownExpression) SetNotTight() { u.tight = false } -func (u UnknownExpression) String() string { +func (u *UnknownExpression) IsTight() bool { return u.tight } +func (u *UnknownExpression) SetNotTight() { u.tight = false } +func (u *UnknownExpression) String() string { return fmt.Sprintf("unknown expression: tight=%t", u.tight) } -func (u UnknownExpression) Copy() Expression { - return UnknownExpression{tight: u.tight} +func (u *UnknownExpression) Copy() Expression { + return &UnknownExpression{tight: u.tight} } // Makes a (shallow) copy of the root node of the expression identified @@ -112,8 +112,8 @@ func getExprCopy( } case NonInvertedColExpression: return NonInvertedColExpression{} - case UnknownExpression: - return UnknownExpression{tight: e.tight} + case *UnknownExpression: + return &UnknownExpression{tight: e.tight} default: d.Fatalf(t, "unknown expr type") return nil @@ -157,7 +157,7 @@ func TestExpression(t *testing.T) { d.ScanArgs(t, "name", &name) var tight bool d.ScanArgs(t, "tight", &tight) - expr := UnknownExpression{tight: tight} + expr := &UnknownExpression{tight: tight} exprsByName[name] = expr return fmt.Sprintf("%v", expr) case "new-non-inverted-leaf": diff --git a/pkg/sql/opt/exec/execbuilder/scalar.go b/pkg/sql/opt/exec/execbuilder/scalar.go index e79dec8e890a..292215707e60 100644 --- a/pkg/sql/opt/exec/execbuilder/scalar.go +++ b/pkg/sql/opt/exec/execbuilder/scalar.go @@ -505,7 +505,7 @@ func (b *Builder) buildArrayFlatten( func (b *Builder) buildIfErr(ctx *buildScalarCtx, scalar opt.ScalarExpr) (tree.TypedExpr, error) { ifErr := scalar.(*memo.IfErrExpr) - cond, err := b.buildScalar(ctx, ifErr.Cond.(opt.ScalarExpr)) + cond, err := b.buildScalar(ctx, ifErr.Cond) if err != nil { return nil, err } diff --git a/pkg/sql/opt/optbuilder/alter_table.go b/pkg/sql/opt/optbuilder/alter_table.go index b504be322001..de8086b5bb32 100644 --- a/pkg/sql/opt/optbuilder/alter_table.go +++ b/pkg/sql/opt/optbuilder/alter_table.go @@ -75,7 +75,7 @@ func (b *Builder) buildAlterTableSplit(split *tree.Split, inScope *scope) (outSc outScope = inScope.push() b.synthesizeResultColumns(outScope, colinfo.AlterTableSplitColumns) outScope.expr = b.factory.ConstructAlterTableSplit( - inputScope.expr.(memo.RelExpr), + inputScope.expr, expiration, &memo.AlterTableSplitPrivate{ Table: b.factory.Metadata().AddTable(table, &tn), @@ -129,7 +129,7 @@ func (b *Builder) buildAlterTableUnsplit(unsplit *tree.Unsplit, inScope *scope) private.Props = inputScope.makePhysicalProps() outScope.expr = b.factory.ConstructAlterTableUnsplit( - inputScope.expr.(memo.RelExpr), + inputScope.expr, private, ) return outScope @@ -179,7 +179,7 @@ func (b *Builder) buildAlterTableRelocate( checkInputColumns(cmdName, inputScope, colNames, colTypes, 2) outScope.expr = b.factory.ConstructAlterTableRelocate( - inputScope.expr.(memo.RelExpr), + inputScope.expr, &memo.AlterTableRelocatePrivate{ RelocateLease: relocate.RelocateLease, RelocateNonVoters: relocate.RelocateNonVoters, diff --git a/pkg/sql/opt/optbuilder/distinct.go b/pkg/sql/opt/optbuilder/distinct.go index 53843426bb60..9167731f0175 100644 --- a/pkg/sql/opt/optbuilder/distinct.go +++ b/pkg/sql/opt/optbuilder/distinct.go @@ -45,7 +45,7 @@ func (b *Builder) constructDistinct(inScope *scope) memo.RelExpr { // We don't set def.Ordering. Because the ordering can only refer to projected // columns, it does not affect the results; it doesn't need to be required of // the DistinctOn input. - input := inScope.expr.(memo.RelExpr) + input := inScope.expr return b.factory.ConstructDistinctOn(input, memo.EmptyAggregationsExpr, &private) } @@ -155,7 +155,7 @@ func (b *Builder) buildDistinctOn( } } - input := inScope.expr.(memo.RelExpr) + input := inScope.expr if nullsAreDistinct { if errorOnDup == "" { outScope.expr = b.factory.ConstructUpsertDistinctOn(input, aggs, &private) diff --git a/pkg/sql/opt/optbuilder/explain.go b/pkg/sql/opt/optbuilder/explain.go index 284e42517390..dbbb8ccbfb12 100644 --- a/pkg/sql/opt/optbuilder/explain.go +++ b/pkg/sql/opt/optbuilder/explain.go @@ -63,7 +63,7 @@ func (b *Builder) buildExplain(explain *tree.Explain, inScope *scope) (outScope } b.synthesizeResultColumns(outScope, colinfo.ExplainPlanColumns) - input := stmtScope.expr.(memo.RelExpr) + input := stmtScope.expr private := memo.ExplainPrivate{ Options: explain.ExplainOptions, ColList: colsToColList(outScope.cols), diff --git a/pkg/sql/opt/optbuilder/export.go b/pkg/sql/opt/optbuilder/export.go index 6c113ca2c7d5..8817a7f765c4 100644 --- a/pkg/sql/opt/optbuilder/export.go +++ b/pkg/sql/opt/optbuilder/export.go @@ -34,7 +34,7 @@ func (b *Builder) buildExport(export *tree.Export, inScope *scope) (outScope *sc outScope = inScope.push() b.synthesizeResultColumns(outScope, colinfo.ExportColumns) outScope.expr = b.factory.ConstructExport( - inputScope.expr.(memo.RelExpr), + inputScope.expr, fileName, options, &memo.ExportPrivate{ diff --git a/pkg/sql/opt/optbuilder/groupby.go b/pkg/sql/opt/optbuilder/groupby.go index 316badafd804..8c255b930b14 100644 --- a/pkg/sql/opt/optbuilder/groupby.go +++ b/pkg/sql/opt/optbuilder/groupby.go @@ -431,7 +431,7 @@ func (b *Builder) buildAggregation(having opt.ScalarExpr, fromScope *scope) (out b.constructProjectForScope(fromScope, g.aggInScope) g.aggOutScope.expr = b.constructGroupBy( - g.aggInScope.expr.(memo.RelExpr), + g.aggInScope.expr, groupingColSet, aggCols, g.aggInScope.ordering, @@ -439,7 +439,7 @@ func (b *Builder) buildAggregation(having opt.ScalarExpr, fromScope *scope) (out // Wrap with having filter if it exists. if having != nil { - input := g.aggOutScope.expr.(memo.RelExpr) + input := g.aggOutScope.expr filters := memo.FiltersExpr{b.factory.ConstructFiltersItem(having)} g.aggOutScope.expr = b.factory.ConstructSelect(input, filters) } diff --git a/pkg/sql/opt/optbuilder/join.go b/pkg/sql/opt/optbuilder/join.go index 1c68ff1380a4..68ca70fb1aea 100644 --- a/pkg/sql/opt/optbuilder/join.go +++ b/pkg/sql/opt/optbuilder/join.go @@ -126,8 +126,8 @@ func (b *Builder) buildJoin( filters = memo.TrueFilter } - left := leftScope.expr.(memo.RelExpr) - right := rightScope.expr.(memo.RelExpr) + left := leftScope.expr + right := rightScope.expr outScope.expr = b.constructJoin( joinType, left, right, filters, &memo.JoinPrivate{Flags: flags}, isLateral, ) @@ -403,8 +403,8 @@ func (jb *usingJoinBuilder) finishBuild() { jb.outScope.expr = jb.b.constructJoin( jb.joinType, - jb.leftScope.expr.(memo.RelExpr), - jb.rightScope.expr.(memo.RelExpr), + jb.leftScope.expr, + jb.rightScope.expr, jb.filters, &memo.JoinPrivate{Flags: jb.joinFlags}, jb.isLateral, @@ -421,7 +421,7 @@ func (jb *usingJoinBuilder) finishBuild() { } } - jb.outScope.expr = jb.b.constructProject(jb.outScope.expr.(memo.RelExpr), jb.outScope.cols) + jb.outScope.expr = jb.b.constructProject(jb.outScope.expr, jb.outScope.cols) } } diff --git a/pkg/sql/opt/optbuilder/limit.go b/pkg/sql/opt/optbuilder/limit.go index f6782d7221e8..baa967ad94f1 100644 --- a/pkg/sql/opt/optbuilder/limit.go +++ b/pkg/sql/opt/optbuilder/limit.go @@ -11,7 +11,6 @@ package optbuilder import ( - "github.com/cockroachdb/cockroach/pkg/sql/opt/memo" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" ) @@ -24,14 +23,14 @@ import ( // are not valid. func (b *Builder) buildLimit(limit *tree.Limit, parentScope, inScope *scope) { if limit.Offset != nil { - input := inScope.expr.(memo.RelExpr) + input := inScope.expr offset := b.resolveAndBuildScalar( limit.Offset, types.Int, exprKindOffset, tree.RejectSpecial, parentScope, ) inScope.expr = b.factory.ConstructOffset(input, offset, inScope.makeOrderingChoice()) } if limit.Count != nil { - input := inScope.expr.(memo.RelExpr) + input := inScope.expr limit := b.resolveAndBuildScalar( limit.Count, types.Int, exprKindLimit, tree.RejectSpecial, parentScope, ) diff --git a/pkg/sql/opt/optbuilder/misc_statements.go b/pkg/sql/opt/optbuilder/misc_statements.go index 18e346b3f705..fc6079222cff 100644 --- a/pkg/sql/opt/optbuilder/misc_statements.go +++ b/pkg/sql/opt/optbuilder/misc_statements.go @@ -45,7 +45,7 @@ func (b *Builder) buildControlJobs(n *tree.ControlJobs, inScope *scope) (outScop ) outScope = inScope.push() outScope.expr = b.factory.ConstructControlJobs( - inputScope.expr.(memo.RelExpr), + inputScope.expr, reason, &memo.ControlJobsPrivate{ Props: inputScope.makePhysicalProps(), @@ -71,7 +71,7 @@ func (b *Builder) buildCancelQueries(n *tree.CancelQueries, inScope *scope) (out ) outScope = inScope.push() outScope.expr = b.factory.ConstructCancelQueries( - inputScope.expr.(memo.RelExpr), + inputScope.expr, &memo.CancelPrivate{ Props: inputScope.makePhysicalProps(), IfExists: n.IfExists, @@ -96,7 +96,7 @@ func (b *Builder) buildCancelSessions(n *tree.CancelSessions, inScope *scope) (o ) outScope = inScope.push() outScope.expr = b.factory.ConstructCancelSessions( - inputScope.expr.(memo.RelExpr), + inputScope.expr, &memo.CancelPrivate{ Props: inputScope.makePhysicalProps(), IfExists: n.IfExists, @@ -128,7 +128,7 @@ func (b *Builder) buildControlSchedules( outScope = inScope.push() outScope.expr = b.factory.ConstructControlSchedules( - inputScope.expr.(memo.RelExpr), + inputScope.expr, &memo.ControlSchedulesPrivate{ Props: inputScope.makePhysicalProps(), Command: n.Command, diff --git a/pkg/sql/opt/optbuilder/mutation_builder.go b/pkg/sql/opt/optbuilder/mutation_builder.go index b9d2f5d1741f..604b204d16f8 100644 --- a/pkg/sql/opt/optbuilder/mutation_builder.go +++ b/pkg/sql/opt/optbuilder/mutation_builder.go @@ -321,8 +321,8 @@ func (mb *mutationBuilder) buildInputForUpdate( mb.outScope.appendColumnsFromScope(mb.fetchScope) mb.outScope.appendColumnsFromScope(fromScope) - left := mb.fetchScope.expr.(memo.RelExpr) - right := fromScope.expr.(memo.RelExpr) + left := mb.fetchScope.expr + right := fromScope.expr mb.outScope.expr = mb.b.factory.ConstructInnerJoin(left, right, memo.TrueFilter, memo.EmptyJoinPrivate) } else { mb.outScope = mb.fetchScope @@ -1391,7 +1391,7 @@ func checkDatumTypeFitsColumnType(col *cat.Column, typ *types.T) { // cast from a column type in inScope to the corresponding target column type, // then this function will error. func (mb *mutationBuilder) addAssignmentCasts(inScope *scope, outTypes []*types.T) *scope { - expr := inScope.expr.(memo.RelExpr) + expr := inScope.expr // Do a quick check to see if any casts are needed. castRequired := false diff --git a/pkg/sql/opt/optbuilder/project.go b/pkg/sql/opt/optbuilder/project.go index 26f570a85f47..1f6d087231ca 100644 --- a/pkg/sql/opt/optbuilder/project.go +++ b/pkg/sql/opt/optbuilder/project.go @@ -34,7 +34,7 @@ func (b *Builder) constructProjectForScope(inScope, projectionsScope *scope) { projectionsScope.expr = inScope.expr } else { projectionsScope.expr = b.constructProject( - inScope.expr.(memo.RelExpr), + inScope.expr, append(projectionsScope.cols, projectionsScope.extraCols...), ) } diff --git a/pkg/sql/opt/optbuilder/select.go b/pkg/sql/opt/optbuilder/select.go index b22c737f3055..58a7a2f77b7d 100644 --- a/pkg/sql/opt/optbuilder/select.go +++ b/pkg/sql/opt/optbuilder/select.go @@ -814,7 +814,7 @@ func (b *Builder) buildWithOrdinality(inScope *scope) (outScope *scope) { // See https://www.cockroachlabs.com/docs/stable/query-order.html#order-preservation // for the semantics around WITH ORDINALITY and ordering. - input := inScope.expr.(memo.RelExpr) + input := inScope.expr inScope.expr = b.factory.ConstructOrdinality(input, &memo.OrdinalityPrivate{ Ordering: inScope.makeOrderingChoice(), ColID: col.id, @@ -1110,7 +1110,7 @@ func (b *Builder) buildWhere(where *tree.Where, inScope *scope) { // Wrap the filter in a FiltersOp. inScope.expr = b.factory.ConstructSelect( - inScope.expr.(memo.RelExpr), + inScope.expr, memo.FiltersExpr{b.factory.ConstructFiltersItem(filter)}, ) } @@ -1168,8 +1168,8 @@ func (b *Builder) buildFromTablesRightDeep( outScope.appendColumnsFromScope(tableScope) - left := outScope.expr.(memo.RelExpr) - right := tableScope.expr.(memo.RelExpr) + left := outScope.expr + right := tableScope.expr outScope.expr = b.factory.ConstructInnerJoin(left, right, memo.TrueFilter, memo.EmptyJoinPrivate) return outScope } @@ -1220,8 +1220,8 @@ func (b *Builder) buildFromWithLateral( outScope.appendColumnsFromScope(tableScope) - left := outScope.expr.(memo.RelExpr) - right := tableScope.expr.(memo.RelExpr) + left := outScope.expr + right := tableScope.expr outScope.expr = b.factory.ConstructInnerJoinApply(left, right, memo.TrueFilter, memo.EmptyJoinPrivate) } diff --git a/pkg/sql/opt/optbuilder/subquery.go b/pkg/sql/opt/optbuilder/subquery.go index 448fd815060f..f3d67db45dbd 100644 --- a/pkg/sql/opt/optbuilder/subquery.go +++ b/pkg/sql/opt/optbuilder/subquery.go @@ -241,12 +241,12 @@ func (s *subquery) buildSubquery(desiredTypes []*types.T) { // We need to add a projection to remove the extra columns. projScope := outScope.push() projScope.appendColumnsFromScope(outScope) - projScope.expr = s.scope.builder.constructProject(outScope.expr.(memo.RelExpr), projScope.cols) + projScope.expr = s.scope.builder.constructProject(outScope.expr, projScope.cols) outScope = projScope } s.cols = outScope.cols - s.node = outScope.expr.(memo.RelExpr) + s.node = outScope.expr s.ordering = ord } diff --git a/pkg/sql/opt/optbuilder/union.go b/pkg/sql/opt/optbuilder/union.go index 4dcfb27da631..25effe7a3db0 100644 --- a/pkg/sql/opt/optbuilder/union.go +++ b/pkg/sql/opt/optbuilder/union.go @@ -81,8 +81,8 @@ func (b *Builder) buildSetOp( rightCols := colsToColList(rightScope.cols) newCols := colsToColList(outScope.cols) - left := leftScope.expr.(memo.RelExpr) - right := rightScope.expr.(memo.RelExpr) + left := leftScope.expr + right := rightScope.expr private := memo.SetPrivate{LeftCols: leftCols, RightCols: rightCols, OutCols: newCols} if all { @@ -200,7 +200,7 @@ func determineUnionType(left, right *types.T, clauseTag string) *types.T { // addCasts adds a projection to a scope, adding casts as necessary so that the // resulting columns have the given types. func (b *Builder) addCasts(dst *scope, outTypes []*types.T) *scope { - expr := dst.expr.(memo.RelExpr) + expr := dst.expr dstCols := dst.cols dst = dst.push() diff --git a/pkg/sql/opt/optbuilder/window.go b/pkg/sql/opt/optbuilder/window.go index f75a1ac00a6e..f07dc07f390d 100644 --- a/pkg/sql/opt/optbuilder/window.go +++ b/pkg/sql/opt/optbuilder/window.go @@ -305,7 +305,7 @@ func (b *Builder) buildAggregationAsWindow( // Wrap with having filter if it exists. if having != nil { - input := g.aggOutScope.expr.(memo.RelExpr) + input := g.aggOutScope.expr filters := memo.FiltersExpr{b.factory.ConstructFiltersItem(having)} g.aggOutScope.expr = b.factory.ConstructSelect(input, filters) } diff --git a/pkg/sql/opt/xform/physical_props.go b/pkg/sql/opt/xform/physical_props.go index 8e000a410943..9f2c56752e83 100644 --- a/pkg/sql/opt/xform/physical_props.go +++ b/pkg/sql/opt/xform/physical_props.go @@ -109,7 +109,7 @@ func BuildChildPhysicalProps( childProps.LimitHint = parentProps.LimitHint case opt.DistinctOnOp: - distinctCount := parent.(memo.RelExpr).Relational().Stats.RowCount + distinctCount := parent.Relational().Stats.RowCount if parentProps.LimitHint > 0 { // TODO(mgartner): If the expression is a streaming DistinctOn, this // estimated limit hint is much lower than it should be. @@ -127,7 +127,7 @@ func BuildChildPhysicalProps( break } - outputRows := parent.(memo.RelExpr).Relational().Stats.RowCount + outputRows := parent.Relational().Stats.RowCount if outputRows == 0 || outputRows < parentProps.LimitHint { break } @@ -145,7 +145,7 @@ func BuildChildPhysicalProps( case opt.SelectOp, opt.LookupJoinOp: // These operations are assumed to produce a constant number of output rows // for each input row, independent of already-processed rows. - outputRows := parent.(memo.RelExpr).Relational().Stats.RowCount + outputRows := parent.Relational().Stats.RowCount if outputRows == 0 || outputRows < parentProps.LimitHint { break } diff --git a/pkg/sql/opt_exec_factory.go b/pkg/sql/opt_exec_factory.go index cd8753b72b0b..a491c582d932 100644 --- a/pkg/sql/opt_exec_factory.go +++ b/pkg/sql/opt_exec_factory.go @@ -248,8 +248,7 @@ func constructSimpleProjectForPlanNode( r.reqOrdering = ReqOrdering(reqOrdering) return r, nil } - inputCols := planColumns(n.(planNode)) - + inputCols := planColumns(n) var rb renderBuilder rb.init(n, reqOrdering) diff --git a/pkg/sql/schemachanger/scexec/exec_mutation.go b/pkg/sql/schemachanger/scexec/exec_mutation.go index bec0cf9bf0f8..c2d04b030f11 100644 --- a/pkg/sql/schemachanger/scexec/exec_mutation.go +++ b/pkg/sql/schemachanger/scexec/exec_mutation.go @@ -91,11 +91,10 @@ func (mvs *mutationVisitorState) CheckOutDescriptor( if entry != nil { return entry.(catalog.MutableDescriptor), nil } - desc, err := mvs.c.MustReadMutableDescriptor(ctx, id) + mut, err := mvs.c.MustReadMutableDescriptor(ctx, id) if err != nil { return nil, err } - mut := desc.(catalog.MutableDescriptor) mut.MaybeIncrementVersion() mvs.checkedOutDescriptors.Upsert(mut) return mut, nil diff --git a/pkg/storage/metamorphic/operands.go b/pkg/storage/metamorphic/operands.go index 05a0fe8e7ca2..11351a93aee3 100644 --- a/pkg/storage/metamorphic/operands.go +++ b/pkg/storage/metamorphic/operands.go @@ -223,7 +223,7 @@ func (v *valueGenerator) closeAll() { } func (v *valueGenerator) toString(value []byte) string { - return fmt.Sprintf("%s", value) + return string(value) } func (v *valueGenerator) parse(input string) []byte { diff --git a/pkg/storage/pebble.go b/pkg/storage/pebble.go index fac727a01a7b..f6c252d51f0a 100644 --- a/pkg/storage/pebble.go +++ b/pkg/storage/pebble.go @@ -855,12 +855,13 @@ func (p *Pebble) NewMVCCIterator(iterKind MVCCIterKind, opts IterOptions) MVCCIt } return iter } - iter := MVCCIterator(newPebbleIterator(p.db, nil, opts)) + + iter := newPebbleIterator(p.db, nil, opts) if iter == nil { panic("couldn't create a new iterator") } if util.RaceEnabled { - iter = wrapInUnsafeIter(iter) + return wrapInUnsafeIter(iter) } return iter } diff --git a/pkg/testutils/lint/lint_test.go b/pkg/testutils/lint/lint_test.go index eb4e407e5495..736d99eafae1 100644 --- a/pkg/testutils/lint/lint_test.go +++ b/pkg/testutils/lint/lint_test.go @@ -1690,16 +1690,11 @@ func TestLint(t *testing.T) { // staticcheck uses 2.4GB of ram (as of 2019-05-10), so don't parallelize it. skip.UnderShort(t) skip.UnderBazelWithIssue(t, 68496, "A TON of build errors") - var args []string - if pkgSpecified { - args = []string{pkgScope} - } else { - args = []string{"-unused.whole-program", pkgScope} - } + cmd, stderr, filter, err := dirCmd( crdb.Dir, "staticcheck", - args...) + pkgScope) if err != nil { t.Fatal(err) } diff --git a/pkg/util/log/vmodule.go b/pkg/util/log/vmodule.go index 6dcaf7103ca6..1ff1575e4405 100644 --- a/pkg/util/log/vmodule.go +++ b/pkg/util/log/vmodule.go @@ -145,9 +145,7 @@ func (c *vmoduleConfig) setV(pc [1]uintptr) Level { frame, _ := runtime.CallersFrames(pc[:]).Next() file := frame.File // The file is something like /a/b/c/d.go. We want just the d. - if strings.HasSuffix(file, ".go") { - file = file[:len(file)-3] - } + file = strings.TrimSuffix(file, ".go") if slash := strings.LastIndexByte(file, '/'); slash >= 0 { file = file[slash+1:] } diff --git a/vendor b/vendor index 1b9ad708ac24..689ec18ab72c 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 1b9ad708ac24e1f35d450ee3a06caf8156156de9 +Subproject commit 689ec18ab72c485bc75191b5b88667051aeb919d