Skip to content

Commit 06c2f17

Browse files
committed
all: gofmt
Gofmt to update doc comments to the new formatting. For golang/go#51082. Change-Id: I5fd6eaa2a711d27051045aaaef45799a12777e48 Reviewed-on: https://go-review.googlesource.com/c/vuln/+/399605 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
1 parent 47a3594 commit 06c2f17

File tree

7 files changed

+58
-54
lines changed

7 files changed

+58
-54
lines changed

Diff for: client/client.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// was added. The index file is called indx.json, and has the
1313
// following format:
1414
//
15-
// map[string]time.Time (DBIndex)
15+
// map[string]time.Time (DBIndex)
1616
//
1717
// Each vulnerable module is represented by an individual JSON file
1818
// which contains all of the vulnerabilities in that module. The path
@@ -21,7 +21,7 @@
2121
// golang.org/x/crypto.json file. The per-module JSON files have
2222
// the following format:
2323
//
24-
// []osv.Entry
24+
// []osv.Entry
2525
//
2626
// A single client.Client can be used to access multiple vulnerability
2727
// databases. When looking up vulnerable module each database is

Diff for: cmd/govulncheck/main.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// It uses static analysis or the binary's symbol table to narrow down reports to only
1212
// those that potentially affect the application.
1313
//
14-
// WARNING WARNING WARNING
14+
// # WARNING WARNING WARNING
1515
//
1616
// govulncheck is still experimental and neither its output or the vulnerability
1717
// database should be relied on to be stable or comprehensive.
@@ -290,10 +290,11 @@ func latestFixed(as []osv.Affected) string {
290290
// summarizeCallStack returns a short description of the call stack.
291291
// It uses one of two forms, depending on what the lowest function F in topPkgs
292292
// calls:
293-
// - If it calls a function V from the vulnerable package, then summarizeCallStack
294-
// returns "F calls V".
295-
// - If it calls a function G in some other package, which eventually calls V,
296-
// it returns "F calls G, which eventually calls V".
293+
// - If it calls a function V from the vulnerable package, then summarizeCallStack
294+
// returns "F calls V".
295+
// - If it calls a function G in some other package, which eventually calls V,
296+
// it returns "F calls G, which eventually calls V".
297+
//
297298
// If it can't find any of these functions, summarizeCallStack returns the empty string.
298299
func summarizeCallStack(cs vulncheck.CallStack, topPkgs map[string]bool, vulnPkg string) string {
299300
// Find the lowest function in the top packages.

Diff for: vulncheck/binary_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func TestBinary(t *testing.T) {
131131
}
132132
}
133133

134-
// hasGoBuild reports whether the current system can build programs with ``go build''
134+
// hasGoBuild reports whether the current system can build programs with go build
135135
// and then run them with os.StartProcess or exec.Command.
136136
//
137137
// Duplicated from std/internal/testenv

Diff for: vulncheck/helpers_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ func (mc *mockClient) GetByModule(ctx context.Context, a string) ([]*osv.Entry,
2525
}
2626

2727
// testClient contains the following test vulnerabilities
28-
// golang.org/amod/avuln.{VulnData.Vuln1, vulnData.Vuln2}
29-
// golang.org/bmod/bvuln.{Vuln}
28+
//
29+
// golang.org/amod/avuln.{VulnData.Vuln1, vulnData.Vuln2}
30+
// golang.org/bmod/bvuln.{Vuln}
3031
var testClient = &mockClient{
3132
ret: map[string][]*osv.Entry{
3233
"golang.org/amod": []*osv.Entry{

Diff for: vulncheck/source.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import (
1717
)
1818

1919
// Source detects vulnerabilities in pkgs and computes slices of
20-
// - imports graph related to an import of a package with some
21-
// known vulnerabilities
22-
// - requires graph related to a require of a module with a
23-
// package that has some known vulnerabilities
24-
// - call graph leading to the use of a known vulnerable function
25-
// or method
20+
// - imports graph related to an import of a package with some
21+
// known vulnerabilities
22+
// - requires graph related to a require of a module with a
23+
// package that has some known vulnerabilities
24+
// - call graph leading to the use of a known vulnerable function
25+
// or method
2626
func Source(ctx context.Context, pkgs []*Package, cfg *Config) (_ *Result, err error) {
2727
defer derrors.Wrap(&err, "vulncheck.Source")
2828

Diff for: vulncheck/source_test.go

+34-33
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import (
1919
// for the Config.ImportsOnly=true mode. The inlined test code has
2020
// the following package (left) and module (right) imports graphs:
2121
//
22-
// entry/x entry/y entry
23-
// \ / \ / \
24-
// amod/avuln zmod/z amod zmod
25-
// | |
26-
// wmod/w wmod
27-
// | |
28-
// bmod/bvuln bmod
22+
// entry/x entry/y entry
23+
// \ / \ / \
24+
// amod/avuln zmod/z amod zmod
25+
// | |
26+
// wmod/w wmod
27+
// | |
28+
// bmod/bvuln bmod
2929
//
3030
// Packages ending in "vuln" have some known vulnerabilities.
3131
func TestImportsOnly(t *testing.T) {
@@ -171,37 +171,38 @@ func TestImportsOnly(t *testing.T) {
171171
// TestCallGraph checks for call graph vuln slicing correctness.
172172
// The inlined test code has the following call graph
173173
//
174-
// x.X
175-
// / | \
176-
// / d.D1 avuln.VulnData.Vuln1
177-
// / / |
178-
// c.C1 d.internal.Vuln1
179-
// |
180-
// avuln.VulnData.Vuln2
174+
// x.X
175+
// / | \
176+
// / d.D1 avuln.VulnData.Vuln1
177+
// / / |
178+
// c.C1 d.internal.Vuln1
179+
// |
180+
// avuln.VulnData.Vuln2
181181
//
182-
// --------------------y.Y-------------------------------
183-
// / / \ \ \ \
184-
// / / \ \ \ \
185-
// / / \ \ \ \
186-
// c.C4 c.vulnWrap.V.Vuln1(=nil) c.C2 bvuln.Vuln c.C3 c.C3$1
187-
// | | |
188-
// y.benign e.E
182+
// --------------------y.Y-------------------------------
183+
// / / \ \ \ \
184+
// / / \ \ \ \
185+
// / / \ \ \ \
186+
// c.C4 c.vulnWrap.V.Vuln1(=nil) c.C2 bvuln.Vuln c.C3 c.C3$1
187+
// | | |
188+
// y.benign e.E
189189
//
190190
// and this slice
191191
//
192-
// x.X
193-
// / | \
194-
// / d.D1 avuln.VulnData.Vuln1
195-
// / /
196-
// c.C1
197-
// |
198-
// avuln.VulnData.Vuln2
192+
// x.X
193+
// / | \
194+
// / d.D1 avuln.VulnData.Vuln1
195+
// / /
196+
// c.C1
197+
// |
198+
// avuln.VulnData.Vuln2
199+
//
200+
// y.Y
201+
// |
202+
// bvuln.Vuln
203+
// | |
204+
// e.E
199205
//
200-
// y.Y
201-
// |
202-
// bvuln.Vuln
203-
// | |
204-
// e.E
205206
// related to avuln.VulnData.{Vuln1, Vuln2} and bvuln.Vuln vulnerabilities.
206207
func TestCallGraph(t *testing.T) {
207208
e := packagestest.Export(t, packagestest.Modules, []packagestest.Module{

Diff for: vulncheck/utils.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ func siteCallees(call ssa.CallInstruction, callgraph *callgraph.Graph) []*ssa.Fu
9898

9999
// dbTypeFormat formats the name of t according how types
100100
// are encoded in vulnerability database:
101-
// - pointer designation * is skipped
102-
// - full path prefix is skipped as well
101+
// - pointer designation * is skipped
102+
// - full path prefix is skipped as well
103103
func dbTypeFormat(t types.Type) string {
104104
switch tt := t.(type) {
105105
case *types.Pointer:
@@ -118,9 +118,10 @@ func dbTypeFormat(t types.Type) string {
118118
// enclosing package, but not globally.
119119
//
120120
// Examples:
121-
// func (a A) foo (...) {...} -> A.foo
122-
// func foo(...) {...} -> foo
123-
// func (b *B) bar (...) {...} -> B.bar
121+
//
122+
// func (a A) foo (...) {...} -> A.foo
123+
// func foo(...) {...} -> foo
124+
// func (b *B) bar (...) {...} -> B.bar
124125
func dbFuncName(f *ssa.Function) string {
125126
selectBound := func(f *ssa.Function) types.Type {
126127
// If f is a "bound" function introduced by ssa for a given type, return the type.

0 commit comments

Comments
 (0)