internal/lsp/command: remove unnecessary json struct tag

Different naming style for Vuln type is unnecessary.
And, we can safely assume that ID is not empty.

Change-Id: Ifd43b671c814796af0110bad05642187bb1ea655
Reviewed-on: https://go-review.googlesource.com/c/tools/+/395677
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Hana 2022-03-24 17:05:05 -04:00 committed by Hyang-Ah Hana Kim
parent b7db7eb670
commit 1e5ae8399a
3 changed files with 21 additions and 21 deletions

View File

@ -286,16 +286,16 @@ Result:
```
{
"Vuln": []{
"id": string,
"details": string,
"aliases": []string,
"symbol": string,
"pkg_path": string,
"mod_path": string,
"url": string,
"current_version": string,
"fixed_version": string,
"call_stacks": [][]golang.org/x/tools/internal/lsp/command.StackEntry,
"ID": string,
"Details": string,
"Aliases": []string,
"Symbol": string,
"PkgPath": string,
"ModPath": string,
"URL": string,
"CurrentVersion": string,
"FixedVersion": string,
"CallStacks": [][]golang.org/x/tools/internal/lsp/command.StackEntry,
},
}
```

View File

@ -350,35 +350,35 @@ type StackEntry struct {
type Vuln struct {
// ID is the vulnerability ID (osv.Entry.ID).
// https://ossf.github.io/osv-schema/#id-modified-fields
ID string `json:"id,omitempty"`
ID string
// Details is the description of the vulnerability (osv.Entry.Details).
// https://ossf.github.io/osv-schema/#summary-details-fields
Details string `json:"details,omitempty"`
Details string `json:",omitempty"`
// Aliases are alternative IDs of the vulnerability.
// https://ossf.github.io/osv-schema/#aliases-field
Aliases []string `json:"aliases,omitempty"`
Aliases []string `json:",omitempty"`
// Symbol is the name of the detected vulnerable function or method.
Symbol string `json:"symbol,omitempty"`
Symbol string `json:",omitempty"`
// PkgPath is the package path of the detected Symbol.
PkgPath string `json:"pkg_path,omitempty"`
PkgPath string `json:",omitempty"`
// ModPath is the module path corresponding to PkgPath.
// TODO: how do we specify standard library's vulnerability?
ModPath string `json:"mod_path,omitempty"`
ModPath string `json:",omitempty"`
// URL is the URL for more info about the information.
// Either the database specific URL or the one of the URLs
// included in osv.Entry.References.
URL string `json:"url,omitempty"`
URL string `json:",omitempty"`
// Current is the current module version.
CurrentVersion string `json:"current_version,omitempty"`
CurrentVersion string `json:",omitempty"`
// Fixed is the minimum module version that contains the fix.
FixedVersion string `json:"fixed_version,omitempty"`
FixedVersion string `json:",omitempty"`
// Example call stacks.
CallStacks []CallStack `json:"call_stacks,omitempty"`
CallStacks []CallStack `json:",omitempty"`
// TODO: import graph & module graph.
}

View File

@ -670,7 +670,7 @@ var GeneratedAPIJSON = &APIJSON{
Title: "Run vulncheck (experimental)",
Doc: "Run vulnerability check (`govulncheck`).",
ArgDoc: "{\n\t// Dir is the directory from which vulncheck will run from.\n\t\"Dir\": string,\n\t// Package pattern. E.g. \"\", \".\", \"./...\".\n\t\"Pattern\": string,\n}",
ResultDoc: "{\n\t\"Vuln\": []{\n\t\t\"id\": string,\n\t\t\"details\": string,\n\t\t\"aliases\": []string,\n\t\t\"symbol\": string,\n\t\t\"pkg_path\": string,\n\t\t\"mod_path\": string,\n\t\t\"url\": string,\n\t\t\"current_version\": string,\n\t\t\"fixed_version\": string,\n\t\t\"call_stacks\": [][]golang.org/x/tools/internal/lsp/command.StackEntry,\n\t},\n}",
ResultDoc: "{\n\t\"Vuln\": []{\n\t\t\"ID\": string,\n\t\t\"Details\": string,\n\t\t\"Aliases\": []string,\n\t\t\"Symbol\": string,\n\t\t\"PkgPath\": string,\n\t\t\"ModPath\": string,\n\t\t\"URL\": string,\n\t\t\"CurrentVersion\": string,\n\t\t\"FixedVersion\": string,\n\t\t\"CallStacks\": [][]golang.org/x/tools/internal/lsp/command.StackEntry,\n\t},\n}",
},
{
Command: "gopls.start_debugging",