Граф коммитов

780 Коммитов

Автор SHA1 Сообщение Дата
cuishuang a2e15db56b exp: fix some typos
Change-Id: If23d54917054f5ab67bff383c045e425f51e7e02
GitHub-Last-Rev: 1393b77ba2
GitHub-Pull-Request: golang/exp#28
Reviewed-on: https://go-review.googlesource.com/c/exp/+/389596
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
2022-03-07 08:09:10 +00:00
Robert Findley bbda1eaf7a exp/typeparams: add a guide to the new APIs
Add a rough draft of a guide to the new go/ast and go/types APIs
introduced with Go 1.18, including explanation of how the
x/exp/typeparams package helps bridge gaps.

For golang/go#50447

Change-Id: I2a5f9a5f0801a71466a4faa3e42efca75b3c7d3c
Reviewed-on: https://go-review.googlesource.com/c/exp/+/388274
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-03-03 21:25:07 +00:00
Robert Griesemer f922e1b6e9 x/exp/maps: fix tests
The map type argument for the generic function Equal cannot
be inferred from an untyped nil function argument. Provide
a typed nil instead.

Fixes golang/go#51438.

Change-Id: Icf32bb2d66fbb26706e81f1322245b14390741a1
Reviewed-on: https://go-review.googlesource.com/c/exp/+/389374
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-03-03 00:27:15 +00:00
Zvonimir Pavlinovic 77fc55f9b6 vulncheck/internal/binscan: use debug/buildinfo to read module data
Also adds unit tests for Binary.

Change-Id: I72c71a4fe749fa96d803bfec83b28b5555607ad0
Reviewed-on: https://go-review.googlesource.com/c/exp/+/388814
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-03-01 22:37:27 +00:00
Ian Lance Taylor 95fb86dc7e slices: clarify that Grow can modify elements past the length
This is a documentation-only change.

Change-Id: Ic7847471543468f148498785cdb0b1998e1f53b5
Reviewed-on: https://go-review.googlesource.com/c/exp/+/387154
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Eli Bendersky‎ <eliben@golang.org>
2022-03-01 22:02:47 +00:00
Axel Wagner 6cf2b20193 rand: make zero LockedSource useful
By changing LockedSource.src from a pointer to a value its zero value
becomes usable without panics.

Document this behavior and add an example. Notably, it is not simply a
Source protected by a sync.Mutex, as Rand also type-asserts on it for
efficiency.

Fixes golang/go#49342

Change-Id: Iec00766957229b7c67ede37894c9e5b9d6d8f852
Reviewed-on: https://go-review.googlesource.com/c/exp/+/385094
Reviewed-by: Rob Pike <r@golang.org>
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-18 21:58:28 +00:00
Ian Lance Taylor 3a4dbed63f go.mod: run go mod tidy
Clean up dependencies after moving shiny, event, and jsonrpc2 to
separate modules.

For golang/go#37175

Change-Id: Ie72d0eb4b99a625f41615d6ce3bb5c8935eb11c4
Reviewed-on: https://go-review.googlesource.com/c/exp/+/386795
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-02-18 21:56:59 +00:00
Ian Lance Taylor 9948649e6d jsonrpc2: remove replace directive from go.mod
Now that we've commited CL 358814 putting x/exp/event in its own module,
we can remove the replace directive here and just use the new module.

Change-Id: I707efb1a14c33a01f5283bbe3de814212a755ad7
Reviewed-on: https://go-review.googlesource.com/c/exp/+/386554
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2022-02-18 21:15:14 +00:00
Jonathan Amsterdam ea2fe41b63 vulncheck: use a Go test to run a bash script
This allows trybots to be our CI system.

See the similar setup in x/vuln and x/vulndb.

Fixes golang/go#50467.

Change-Id: I3d339101f999846979aac580fe93555f906609be
Reviewed-on: https://go-review.googlesource.com/c/exp/+/386199
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2022-02-18 15:56:46 +00:00
Ian Lance Taylor 1812c5b45e event, jsonrpc2: add go.mod files
Use a replace directive for jsonrpc2 temporarily. After x/exp/event is
available, the replace directive can be removed.

Change-Id: If8486bbe111a33a0ff7140105f30e4696fe2a1e9
Reviewed-on: https://go-review.googlesource.com/c/exp/+/385814
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2022-02-17 17:21:24 +00:00
Robert Findley 058d147d01 typeparams: a new module with a transitional API for generics in tools
Add a new module for use by tool authors that need operate on generic
code, while still building at older Go versions.

This module API proxies the Go 1.18 API for type parameters, providing
stubs at earlier Go versions. It also contains some common helpers to
supplement the go/types API.

For golang/go#50447

Change-Id: I97feb834eb2da646620f8377904520b511871915
Reviewed-on: https://go-review.googlesource.com/c/exp/+/383375
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Trust: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-15 21:41:39 +00:00
Zvonimir Pavlinovic 3e31098684 vulncheck: add imports only mode for vuln detection in binaries
Change-Id: I1acd8ca2fe7bf45abb3ada01f40e63ffd909bcee
Reviewed-on: https://go-review.googlesource.com/c/exp/+/382554
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-02-12 02:31:02 +00:00
Ian Lance Taylor 160e291fcf jsonrpc2: move internal directory into jsonrpc2
The top-level internal directory is only used by jsonrpc2.
Move it into jsonrpc2 so that jsonrpc2 can become its own module.

Change-Id: I8c0fad6b2f343e9abfa9b5397403aa58cb9a0005
Reviewed-on: https://go-review.googlesource.com/c/exp/+/383314
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2022-02-09 04:24:42 +00:00
Ian Lance Taylor f5f519d967 shiny: add go.mod file
The shiny package is not related to other exp packages.
Put it in a separate module.

This package uses a modified copy of github.com/BurntSushi/xgb.
Move that out of the vendor directory, so that current go commands work.

For golang/go#37175

Change-Id: Ib3bad0823d2651ff90a9651e405ed7bcd9de94b6
Reviewed-on: https://go-review.googlesource.com/c/exp/+/383197
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Trust: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-02-05 01:57:13 +00:00
Bryan C. Mills d4f80a9147 constraints: test against the constraints package from x/exp instead of std
Fixes golang/go#50792

Change-Id: I9abb0972c9e51c88591de1cc1ef10337f75f84d0
Reviewed-on: https://go-review.googlesource.com/c/exp/+/382834
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
2022-02-03 16:41:50 +00:00
Zvonimir Pavlinovic bb2893798c vulncheck: add witness search logic for call stacks
The CL adds API for traversal of call graph in search of call stacks
that can serve as witnesses for uses of vulnerable symbols.

Change-Id: Ib45c5c6aad347e1bcecb39ca4a62f589b4766677
Reviewed-on: https://go-review.googlesource.com/c/exp/+/381777
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-03 01:21:08 +00:00
Jonathan Amsterdam a36d682192 event/otel: metrics
Add an event handler for OpenTelemetry metrics.

The first time it sees an event.Metric, the handler creates a matching
otel instrument and caches it. On each call, it uses the instrument to
record the metric value.

Change-Id: I07d6f40601c7d2a801ed9fbe3cf7c24d5698f3f1
Reviewed-on: https://go-review.googlesource.com/c/exp/+/320350
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2022-02-02 21:41:57 +00:00
Ian Lance Taylor 8176bd3bf0 constraints: new package
Move to exp from the pre-1.18 standard library.

For golang/go#45458
For golang/go#50792

Change-Id: I70f054c9d68c20e98e750f6501f3eabd04a70f17
Reviewed-on: https://go-review.googlesource.com/c/exp/+/382535
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-02 21:21:11 +00:00
Zvonimir Pavlinovic c853b6ddb9 vulncheck: add witness search logic for import chains
Change-Id: I342b22595ca1c2b1aa6039ea6e2e7ada65e0faf5
Reviewed-on: https://go-review.googlesource.com/c/exp/+/379994
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
2022-01-28 18:14:51 +00:00
Zvonimir Pavlinovic 073fb13391 vulncheck: add more checks for nil package of a function
Change-Id: Iad61bc4ee41d376e63ca853a0b51633cc07e6fa4
Reviewed-on: https://go-review.googlesource.com/c/exp/+/380835
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-01-26 16:47:34 +00:00
Jonathan Amsterdam 7a6bfc4870 vulncheck: add FuncNode.String
It is a little tricky to get right and is useful outside
of the package.

Change-Id: I8b41aa38ad2982fa7848170b0a880372a27bacca
Reviewed-on: https://go-review.googlesource.com/c/exp/+/380435
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-01-24 17:31:37 +00:00
Jonathan Amsterdam dfff36e9ab vulncheck: check for nil package
Change-Id: I1b291e7077ef48f522e61046b00e24812db60bb0
Reviewed-on: https://go-review.googlesource.com/c/exp/+/380434
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-01-24 17:31:07 +00:00
Zvonimir Pavlinovic 6666425eef vulncheck: add witness data structures
The added data structures are based on the internal discussion and
proposed design document.

Change-Id: I07c3c8fdfcd74d7642e32d8201f1850c48375202
Reviewed-on: https://go-review.googlesource.com/c/exp/+/379574
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-01-24 17:26:54 +00:00
Eli Bendersky 7b334a1653 slices: initial implementation of sorting functions
Implements golang/go#47619 in the exp/slices package as a
testing ground prior to inclusion in the standard library.

Relies on the modified sorting function code generator proposed
in https://go-review.googlesource.com/c/go/+/353069 to
automatically generate the code of the sorting functions.

Benchmark comparing sort.Ints with the generic Sort function
added in this CL to sort a slice of int:

name           old time/op  new time/op  delta
Sort-8         12.0ms ± 1%   6.5ms ± 1%  -46.02%  (p=0.000 n=9+10)

Benchmark comparing sort.Sort with SortFunc to sort a slice of
struct pointers based on one field in the struct:

name           old time/op  new time/op  delta
SortStructs-8  18.6ms ± 2%  15.9ms ± 3%  -14.43%  (p=0.000 n=10+10)

Change-Id: Ic301aae7e5b8f99144e39b8a77fde897779588ed
Reviewed-on: https://go-review.googlesource.com/c/exp/+/378134
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cody Oss <codyoss@google.com>
Trust: Jeremy Faller <jeremy@golang.org>
2022-01-21 17:40:13 +00:00
Jonathan Amsterdam 2c358f7d14 vulncheck: add derrors.Wrap to exported functions
Change-Id: Ifdd98ffe247d6023d942fc8d07db0ce103045e0f
Reviewed-on: https://go-review.googlesource.com/c/exp/+/380134
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-01-21 16:50:43 +00:00
Jonathan Amsterdam 9d54fb3536 event: upgrade to latest Open Telemetry modules
Change-Id: Iff728cc06bd5a22e12680079b20d83526c0ec98b
Reviewed-on: https://go-review.googlesource.com/c/exp/+/375959
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2022-01-14 16:20:06 +00:00
Jonathan Amsterdam 3352c48c51 event: upgrade to latest logr version
Change-Id: Iac36098a6b81809129eebfdc8485b259cb89ce6d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/375958
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2022-01-14 16:19:59 +00:00
Julie Qiu 025e73f804 all: fix misspellings
Change-Id: Id9b0c6295a7cf1b170c383a4b9b0690dafe682b0
Reviewed-on: https://go-review.googlesource.com/c/exp/+/375055
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-01-04 16:01:15 +00:00
Julie Qiu 0ae201e821 go.mod,go.sum: remove unused golang.org/x/vulndb
Change-Id: I46553df80f75b6d29fb42035bebcba44acc0fec1
Reviewed-on: https://go-review.googlesource.com/c/exp/+/375054
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2022-01-04 16:01:08 +00:00
ichxxx e290361785 slices: improve the performance of Equal
Although it does an additional index operation, but it avoids the value copy of the range loop,
and it will has a better performance if E is a large structure.

Compares two int slices, the slices length are 10:
name                old time/op  new time/op  delta
Equal_WithIntSlices  5.80ns ± 0%  5.80ns ± 1%   ~     (p=0.889 n=14+15)

Compares two string slices, the slices length are 10:
name                   old time/op  new time/op  delta
Equal_WithStringSlices  17.6ns ± 1%  16.6ns ± 0%  -5.61%  (p=0.000 n=15+15)

Compares two runtime.MemStats slices, the slices length are 10:
name                        old time/op  new time/op  delta
Equal_WithLagerStructSlices  4.46µs ± 0%  1.53µs ± 1%  -65.67%  (p=0.000 n=15+15)

Change-Id: I654b4fd4d7c6c3e233e8ee963e0c510e185d398b
GitHub-Last-Rev: 274949314f
GitHub-Pull-Request: golang/exp#24
Reviewed-on: https://go-review.googlesource.com/c/exp/+/373394
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-21 22:30:16 +00:00
ye.sijun 5559a165f5 mmap: use unsafe.Slice rather than maxBytes array
Fixes golang/go#49106

Change-Id: I79883a26d8c444645e86449c35e331bb749501a9
GitHub-Last-Rev: 614eef621c
GitHub-Pull-Request: golang/exp#22
Reviewed-on: https://go-review.googlesource.com/c/exp/+/372834
Reviewed-by: Yaakov Selkowitz <yselkowi@redhat.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-21 17:41:06 +00:00
Johan Jansson b2b84827b7 cmd/txtar: extract only in current dir by default
Change the behavior of txtar so that files are extracted only in the
current directory, or a subdirectory of the current directory, by
default.

If the archive contains a path outside the current directory, txtar will
print an error message and quit with exit code 1. It will not extract
any files in this case. This also applies if an environment variable
used in the archive expands into a path outside the current directory.

Add flag -unsafe to remove the restriction and allow extracting files
outside the current dir.

Updates golang/go#46741

Change-Id: Ic12fb8286c5f2a930addd82dcfce196d4a04054c
Reviewed-on: https://go-review.googlesource.com/c/exp/+/371274
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-16 16:40:55 +00:00
Zvonimir Pavlinovic bafe2e2020 vulncheck: make API use IDs for entries and proper names for nodes
The change also introduces a small fix to an issue related to entry
points.

Change-Id: Id571a31cc86e9129d9fd2392211f1199720eda1d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/371774
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-14 22:31:57 +00:00
Zvonimir Pavlinovic c0d16f17ae vulncheck: fix support for packages whose every symbol is vulnerable
Some vulnerabilities have an empty slice for the osv.Entry Symbols
field, meaning every symbol is vulnerable. This CL adds support for such
vulnerabilities by doing the following, when an import of the
corresponding packages is seen, we list every top-level method and
function of that package and add it as a Vuln in vulncheck.Result.

Change-Id: I0edac51f7e3923ecfd3f203db80e6f7d22272dd2
Reviewed-on: https://go-review.googlesource.com/c/exp/+/371254
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-14 19:10:49 +00:00
Zvonimir Pavlinovic 79cd87713b vulncheck: include proper filtering of vulnerabilities
Change-Id: I4f0823ef6bdc43399e678c95bb8120af1afdd2f7
Reviewed-on: https://go-review.googlesource.com/c/exp/+/370457
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Jonathan Amsterdam <jba@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-13 17:38:48 +00:00
Zvonimir Pavlinovic e05463a05a vulncheck,vulndb/internal/audit: fix skipping load of local packages
If a module had empty Dir, we would consider it a valid local dir. This
resulted in skipping loading of such modules, which is incorrect.

Change-Id: I71e965b521387d184bf790398ddacf05ef10ab65
Reviewed-on: https://go-review.googlesource.com/c/exp/+/370934
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-10 18:56:55 +00:00
Zvonimir Pavlinovic 596ef3bc44 govulncheck: use proper go env variables everywhere
Change-Id: I5c47125f00c1f99688e1bd6bfd57b720c99c7261
Reviewed-on: https://go-review.googlesource.com/c/exp/+/370914
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-10 17:54:47 +00:00
Zvonimir Pavlinovic e15458d83c vulncheck: use new version of vulnerability database module
Change-Id: Ie86918dd46aef0267d883a99c25b3220f0690e96
Reviewed-on: https://go-review.googlesource.com/c/exp/+/370456
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-10 16:47:46 +00:00
Zvonimir Pavlinovic 6e94b45d16 vulncheck: replace packages.Package with vulncheck.Package
packages.Package can consume a lot of memory for some clients,
so we use its trimmed version vulncheck.Packages instead.

Change-Id: I2f1b50bbc101fdf6aaf49271d51f41cdf4be5cc1
Reviewed-on: https://go-review.googlesource.com/c/exp/+/369135
Reviewed-by: Julie Qiu <julie@golang.org>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-09 18:21:45 +00:00
Zvonimir Pavlinovic 4f2595aad9 vulncheck: introduce vulncheck.Package
This change introduces vulncheck.Package representation of input
packages and adds conversion API from packages.Package.

This change will be followed by a change that replaces uses of
packages.Package with those of vulncheck.Package.

Change-Id: I4e72bc8e934ebca86d3039ae27ae05820b73d9d6
Reviewed-on: https://go-review.googlesource.com/c/exp/+/369134
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-07 00:10:50 +00:00
Julie Qiu cf323a8235 vulncheck: update all.bash
Various fixes are made to the vulncheck/all.bash file.

Change-Id: I9cc0a980f55967aaf66deb9135c62c5b7dd9b44a
Reviewed-on: https://go-review.googlesource.com/c/exp/+/369514
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-12-06 21:12:00 +00:00
Hana 8a230f1f7d vulndb/govulncheck: use GOOS/GOARCH env vars for target analysis
This allows to correctly filter vulnerabilities for the analysis
beyond the host platform.

Change-Id: I57003d4ccf77cde6a1064ec9c28c6fc31ae48d5d
Reviewed-on: https://go-review.googlesource.com/c/exp/+/366374
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-11-29 23:41:52 +00:00
Hana 48cbe7f80d vulndb/internal/audit: add missing copyright header
Change-Id: I3d1b59304b18d730dee148142cf1286a26f9da18
Reviewed-on: https://go-review.googlesource.com/c/exp/+/365594
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-11-23 02:16:43 +00:00
Zvonimir Pavlinovic ba1b3c3563 vulncheck: add support for callgraph source vuln detection
Change-Id: I37b15de3f25ca6df5341859f73494e13e5d41b79
Reviewed-on: https://go-review.googlesource.com/c/exp/+/365114
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-11-22 17:40:06 +00:00
fzipp d9423ad707 maps: turn map constraint of Copy function into an approximation element
Fixes golang/go#49698

Change-Id: I62e25f11695d2a2729588dbb559ec6e144beb5a2
Reviewed-on: https://go-review.googlesource.com/c/exp/+/365575
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
2021-11-21 16:27:02 +00:00
Ian Lance Taylor c35f6fddc5 maps: new package
For golang/go#47649

Change-Id: I49c9b1aab0e2204bde7b7e21d68130551118bf92
Reviewed-on: https://go-review.googlesource.com/c/exp/+/364875
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-11-19 21:21:39 +00:00
Zvonimir Pavlinovic 2234ab416e exp/vulncheck: add vulnerability detection for binaries
The binscan package has been mostly copied from internal/audit. The only
change is to use io.ReaderAt as a input binary instead of a file path.

Change-Id: I883139796121bd1d18a6fd828216ff5a36e01421
Reviewed-on: https://go-review.googlesource.com/c/exp/+/363013
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Trust: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-11-19 20:37:53 +00:00
Hana 0590e08842 vulndb: replace golang.org/x/vulndb with golang.org/x/vuln
APIs for accessing data from the Go Vulnerability Database were moved
to a separate repo golang.org/x/vuln.

And the client interface was changed, so this CL updates the references.

Change-Id: I46831ca757ada6122332c7d1dd7c4762e5278597
Reviewed-on: https://go-review.googlesource.com/c/exp/+/364857
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Zvonimir Pavlinovic <zpavlinovic@google.com>
2021-11-19 02:03:29 +00:00
Ian Lance Taylor eb295bbb7f slices: preserve nil/non-nil in Clone
Fixes golang/go#49660

Change-Id: I2bc371fed2193293509573d8994c94775edcf25e
Reviewed-on: https://go-review.googlesource.com/c/exp/+/365174
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-11-18 22:39:01 +00:00
Ian Lance Taylor 03df57b9a5 slices: new package
Update the go version in go.mod to go1.18 so that generics are permitted.

For golang/go#45955

Change-Id: Id5ab52d38c465313c27506008aece9356d34e3c9
Reviewed-on: https://go-review.googlesource.com/c/exp/+/363434
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-11-17 21:41:01 +00:00