github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/internal/lsp/source/api_json.go (about)

     1  // Code generated by "github.com/powerman/golang-tools/gopls/doc/generate"; DO NOT EDIT.
     2  
     3  package source
     4  
     5  var GeneratedAPIJSON = &APIJSON{
     6  	Options: map[string][]*OptionJSON{
     7  		"User": {
     8  			{
     9  				Name:      "buildFlags",
    10  				Type:      "[]string",
    11  				Doc:       "buildFlags is the set of flags passed on to the build system when invoked.\nIt is applied to queries like `go list`, which is used when discovering files.\nThe most common use is to set `-tags`.\n",
    12  				Default:   "[]",
    13  				Hierarchy: "build",
    14  			},
    15  			{
    16  				Name:      "env",
    17  				Type:      "map[string]string",
    18  				Doc:       "env adds environment variables to external commands run by `gopls`, most notably `go list`.\n",
    19  				Default:   "{}",
    20  				Hierarchy: "build",
    21  			},
    22  			{
    23  				Name:      "directoryFilters",
    24  				Type:      "[]string",
    25  				Doc:       "directoryFilters can be used to exclude unwanted directories from the\nworkspace. By default, all directories are included. Filters are an\noperator, `+` to include and `-` to exclude, followed by a path prefix\nrelative to the workspace folder. They are evaluated in order, and\nthe last filter that applies to a path controls whether it is included.\nThe path prefix can be empty, so an initial `-` excludes everything.\n\nExamples:\n\nExclude node_modules: `-node_modules`\n\nInclude only project_a: `-` (exclude everything), `+project_a`\n\nInclude only project_a, but not node_modules inside it: `-`, `+project_a`, `-project_a/node_modules`\n",
    26  				Default:   "[\"-node_modules\"]",
    27  				Hierarchy: "build",
    28  			},
    29  			{
    30  				Name:      "templateExtensions",
    31  				Type:      "[]string",
    32  				Doc:       "templateExtensions gives the extensions of file names that are treateed\nas template files. (The extension\nis the part of the file name after the final dot.)\n",
    33  				Default:   "[]",
    34  				Hierarchy: "build",
    35  			},
    36  			{
    37  				Name: "memoryMode",
    38  				Type: "enum",
    39  				Doc:  "memoryMode controls the tradeoff `gopls` makes between memory usage and\ncorrectness.\n\nValues other than `Normal` are untested and may break in surprising ways.\n",
    40  				EnumValues: []EnumValue{
    41  					{
    42  						Value: "\"DegradeClosed\"",
    43  						Doc:   "`\"DegradeClosed\"`: In DegradeClosed mode, `gopls` will collect less information about\npackages without open files. As a result, features like Find\nReferences and Rename will miss results in such packages.\n",
    44  					},
    45  					{Value: "\"Normal\""},
    46  				},
    47  				Default:   "\"Normal\"",
    48  				Status:    "experimental",
    49  				Hierarchy: "build",
    50  			},
    51  			{
    52  				Name:      "expandWorkspaceToModule",
    53  				Type:      "bool",
    54  				Doc:       "expandWorkspaceToModule instructs `gopls` to adjust the scope of the\nworkspace to find the best available module root. `gopls` first looks for\na go.mod file in any parent directory of the workspace folder, expanding\nthe scope to that directory if it exists. If no viable parent directory is\nfound, gopls will check if there is exactly one child directory containing\na go.mod file, narrowing the scope to that directory if it exists.\n",
    55  				Default:   "true",
    56  				Status:    "experimental",
    57  				Hierarchy: "build",
    58  			},
    59  			{
    60  				Name:      "experimentalWorkspaceModule",
    61  				Type:      "bool",
    62  				Doc:       "experimentalWorkspaceModule opts a user into the experimental support\nfor multi-module workspaces.\n",
    63  				Default:   "false",
    64  				Status:    "experimental",
    65  				Hierarchy: "build",
    66  			},
    67  			{
    68  				Name:      "experimentalPackageCacheKey",
    69  				Type:      "bool",
    70  				Doc:       "experimentalPackageCacheKey controls whether to use a coarser cache key\nfor package type information to increase cache hits. This setting removes\nthe user's environment, build flags, and working directory from the cache\nkey, which should be a safe change as all relevant inputs into the type\nchecking pass are already hashed into the key. This is temporarily guarded\nby an experiment because caching behavior is subtle and difficult to\ncomprehensively test.\n",
    71  				Default:   "true",
    72  				Status:    "experimental",
    73  				Hierarchy: "build",
    74  			},
    75  			{
    76  				Name:      "allowModfileModifications",
    77  				Type:      "bool",
    78  				Doc:       "allowModfileModifications disables -mod=readonly, allowing imports from\nout-of-scope modules. This option will eventually be removed.\n",
    79  				Default:   "false",
    80  				Status:    "experimental",
    81  				Hierarchy: "build",
    82  			},
    83  			{
    84  				Name:      "allowImplicitNetworkAccess",
    85  				Type:      "bool",
    86  				Doc:       "allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module\ndownloads rather than requiring user action. This option will eventually\nbe removed.\n",
    87  				Default:   "false",
    88  				Status:    "experimental",
    89  				Hierarchy: "build",
    90  			},
    91  			{
    92  				Name:      "experimentalUseInvalidMetadata",
    93  				Type:      "bool",
    94  				Doc:       "experimentalUseInvalidMetadata enables gopls to fall back on outdated\npackage metadata to provide editor features if the go command fails to\nload packages for some reason (like an invalid go.mod file). This will\neventually be the default behavior, and this setting will be removed.\n",
    95  				Default:   "false",
    96  				Status:    "experimental",
    97  				Hierarchy: "build",
    98  			},
    99  			{
   100  				Name: "hoverKind",
   101  				Type: "enum",
   102  				Doc:  "hoverKind controls the information that appears in the hover text.\nSingleLine and Structured are intended for use only by authors of editor plugins.\n",
   103  				EnumValues: []EnumValue{
   104  					{Value: "\"FullDocumentation\""},
   105  					{Value: "\"NoDocumentation\""},
   106  					{Value: "\"SingleLine\""},
   107  					{
   108  						Value: "\"Structured\"",
   109  						Doc:   "`\"Structured\"` is an experimental setting that returns a structured hover format.\nThis format separates the signature from the documentation, so that the client\ncan do more manipulation of these fields.\n\nThis should only be used by clients that support this behavior.\n",
   110  					},
   111  					{Value: "\"SynopsisDocumentation\""},
   112  				},
   113  				Default:   "\"FullDocumentation\"",
   114  				Hierarchy: "ui.documentation",
   115  			},
   116  			{
   117  				Name:      "linkTarget",
   118  				Type:      "string",
   119  				Doc:       "linkTarget controls where documentation links go.\nIt might be one of:\n\n* `\"godoc.org\"`\n* `\"pkg.go.dev\"`\n\nIf company chooses to use its own `godoc.org`, its address can be used as well.\n",
   120  				Default:   "\"pkg.go.dev\"",
   121  				Hierarchy: "ui.documentation",
   122  			},
   123  			{
   124  				Name:      "linksInHover",
   125  				Type:      "bool",
   126  				Doc:       "linksInHover toggles the presence of links to documentation in hover.\n",
   127  				Default:   "true",
   128  				Hierarchy: "ui.documentation",
   129  			},
   130  			{
   131  				Name:      "usePlaceholders",
   132  				Type:      "bool",
   133  				Doc:       "placeholders enables placeholders for function parameters or struct\nfields in completion responses.\n",
   134  				Default:   "false",
   135  				Hierarchy: "ui.completion",
   136  			},
   137  			{
   138  				Name:      "completionBudget",
   139  				Type:      "time.Duration",
   140  				Doc:       "completionBudget is the soft latency goal for completion requests. Most\nrequests finish in a couple milliseconds, but in some cases deep\ncompletions can take much longer. As we use up our budget we\ndynamically reduce the search scope to ensure we return timely\nresults. Zero means unlimited.\n",
   141  				Default:   "\"100ms\"",
   142  				Status:    "debug",
   143  				Hierarchy: "ui.completion",
   144  			},
   145  			{
   146  				Name: "matcher",
   147  				Type: "enum",
   148  				Doc:  "matcher sets the algorithm that is used when calculating completion\ncandidates.\n",
   149  				EnumValues: []EnumValue{
   150  					{Value: "\"CaseInsensitive\""},
   151  					{Value: "\"CaseSensitive\""},
   152  					{Value: "\"Fuzzy\""},
   153  				},
   154  				Default:   "\"Fuzzy\"",
   155  				Status:    "advanced",
   156  				Hierarchy: "ui.completion",
   157  			},
   158  			{
   159  				Name:      "experimentalPostfixCompletions",
   160  				Type:      "bool",
   161  				Doc:       "experimentalPostfixCompletions enables artificial method snippets\nsuch as \"someSlice.sort!\".\n",
   162  				Default:   "true",
   163  				Status:    "experimental",
   164  				Hierarchy: "ui.completion",
   165  			},
   166  			{
   167  				Name: "importShortcut",
   168  				Type: "enum",
   169  				Doc:  "importShortcut specifies whether import statements should link to\ndocumentation or go to definitions.\n",
   170  				EnumValues: []EnumValue{
   171  					{Value: "\"Both\""},
   172  					{Value: "\"Definition\""},
   173  					{Value: "\"Link\""},
   174  				},
   175  				Default:   "\"Both\"",
   176  				Hierarchy: "ui.navigation",
   177  			},
   178  			{
   179  				Name: "symbolMatcher",
   180  				Type: "enum",
   181  				Doc:  "symbolMatcher sets the algorithm that is used when finding workspace symbols.\n",
   182  				EnumValues: []EnumValue{
   183  					{Value: "\"CaseInsensitive\""},
   184  					{Value: "\"CaseSensitive\""},
   185  					{Value: "\"FastFuzzy\""},
   186  					{Value: "\"Fuzzy\""},
   187  				},
   188  				Default:   "\"FastFuzzy\"",
   189  				Status:    "advanced",
   190  				Hierarchy: "ui.navigation",
   191  			},
   192  			{
   193  				Name: "symbolStyle",
   194  				Type: "enum",
   195  				Doc:  "symbolStyle controls how symbols are qualified in symbol responses.\n\nExample Usage:\n\n```json5\n\"gopls\": {\n...\n  \"symbolStyle\": \"Dynamic\",\n...\n}\n```\n",
   196  				EnumValues: []EnumValue{
   197  					{
   198  						Value: "\"Dynamic\"",
   199  						Doc:   "`\"Dynamic\"` uses whichever qualifier results in the highest scoring\nmatch for the given symbol query. Here a \"qualifier\" is any \"/\" or \".\"\ndelimited suffix of the fully qualified symbol. i.e. \"to/pkg.Foo.Field\" or\njust \"Foo.Field\".\n",
   200  					},
   201  					{
   202  						Value: "\"Full\"",
   203  						Doc:   "`\"Full\"` is fully qualified symbols, i.e.\n\"path/to/pkg.Foo.Field\".\n",
   204  					},
   205  					{
   206  						Value: "\"Package\"",
   207  						Doc:   "`\"Package\"` is package qualified symbols i.e.\n\"pkg.Foo.Field\".\n",
   208  					},
   209  				},
   210  				Default:   "\"Dynamic\"",
   211  				Status:    "advanced",
   212  				Hierarchy: "ui.navigation",
   213  			},
   214  			{
   215  				Name: "analyses",
   216  				Type: "map[string]bool",
   217  				Doc:  "analyses specify analyses that the user would like to enable or disable.\nA map of the names of analysis passes that should be enabled/disabled.\nA full list of analyzers that gopls uses can be found\n[here](https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md).\n\nExample Usage:\n\n```json5\n...\n\"analyses\": {\n  \"unreachable\": false, // Disable the unreachable analyzer.\n  \"unusedparams\": true  // Enable the unusedparams analyzer.\n}\n...\n```\n",
   218  				EnumKeys: EnumKeys{
   219  					ValueType: "bool",
   220  					Keys: []EnumKey{
   221  						{
   222  							Name:    "\"asmdecl\"",
   223  							Doc:     "report mismatches between assembly files and Go declarations",
   224  							Default: "true",
   225  						},
   226  						{
   227  							Name:    "\"assign\"",
   228  							Doc:     "check for useless assignments\n\nThis checker reports assignments of the form x = x or a[i] = a[i].\nThese are almost always useless, and even when they aren't they are\nusually a mistake.",
   229  							Default: "true",
   230  						},
   231  						{
   232  							Name:    "\"atomic\"",
   233  							Doc:     "check for common mistakes using the sync/atomic package\n\nThe atomic checker looks for assignment statements of the form:\n\n\tx = atomic.AddUint64(&x, 1)\n\nwhich are not atomic.",
   234  							Default: "true",
   235  						},
   236  						{
   237  							Name:    "\"atomicalign\"",
   238  							Doc:     "check for non-64-bits-aligned arguments to sync/atomic functions",
   239  							Default: "true",
   240  						},
   241  						{
   242  							Name:    "\"bools\"",
   243  							Doc:     "check for common mistakes involving boolean operators",
   244  							Default: "true",
   245  						},
   246  						{
   247  							Name:    "\"buildtag\"",
   248  							Doc:     "check that +build tags are well-formed and correctly located",
   249  							Default: "true",
   250  						},
   251  						{
   252  							Name:    "\"cgocall\"",
   253  							Doc:     "detect some violations of the cgo pointer passing rules\n\nCheck for invalid cgo pointer passing.\nThis looks for code that uses cgo to call C code passing values\nwhose types are almost always invalid according to the cgo pointer\nsharing rules.\nSpecifically, it warns about attempts to pass a Go chan, map, func,\nor slice to C, either directly, or via a pointer, array, or struct.",
   254  							Default: "true",
   255  						},
   256  						{
   257  							Name:    "\"composites\"",
   258  							Doc:     "check for unkeyed composite literals\n\nThis analyzer reports a diagnostic for composite literals of struct\ntypes imported from another package that do not use the field-keyed\nsyntax. Such literals are fragile because the addition of a new field\n(even if unexported) to the struct will cause compilation to fail.\n\nAs an example,\n\n\terr = &net.DNSConfigError{err}\n\nshould be replaced by:\n\n\terr = &net.DNSConfigError{Err: err}\n",
   259  							Default: "true",
   260  						},
   261  						{
   262  							Name:    "\"copylocks\"",
   263  							Doc:     "check for locks erroneously passed by value\n\nInadvertently copying a value containing a lock, such as sync.Mutex or\nsync.WaitGroup, may cause both copies to malfunction. Generally such\nvalues should be referred to through a pointer.",
   264  							Default: "true",
   265  						},
   266  						{
   267  							Name:    "\"deepequalerrors\"",
   268  							Doc:     "check for calls of reflect.DeepEqual on error values\n\nThe deepequalerrors checker looks for calls of the form:\n\n    reflect.DeepEqual(err1, err2)\n\nwhere err1 and err2 are errors. Using reflect.DeepEqual to compare\nerrors is discouraged.",
   269  							Default: "true",
   270  						},
   271  						{
   272  							Name:    "\"errorsas\"",
   273  							Doc:     "report passing non-pointer or non-error values to errors.As\n\nThe errorsas analysis reports calls to errors.As where the type\nof the second argument is not a pointer to a type implementing error.",
   274  							Default: "true",
   275  						},
   276  						{
   277  							Name:    "\"fieldalignment\"",
   278  							Doc:     "find structs that would use less memory if their fields were sorted\n\nThis analyzer find structs that can be rearranged to use less memory, and provides\na suggested edit with the optimal order.\n\nNote that there are two different diagnostics reported. One checks struct size,\nand the other reports \"pointer bytes\" used. Pointer bytes is how many bytes of the\nobject that the garbage collector has to potentially scan for pointers, for example:\n\n\tstruct { uint32; string }\n\nhave 16 pointer bytes because the garbage collector has to scan up through the string's\ninner pointer.\n\n\tstruct { string; *uint32 }\n\nhas 24 pointer bytes because it has to scan further through the *uint32.\n\n\tstruct { string; uint32 }\n\nhas 8 because it can stop immediately after the string pointer.\n",
   279  							Default: "false",
   280  						},
   281  						{
   282  							Name:    "\"httpresponse\"",
   283  							Doc:     "check for mistakes using HTTP responses\n\nA common mistake when using the net/http package is to defer a function\ncall to close the http.Response Body before checking the error that\ndetermines whether the response is valid:\n\n\tresp, err := http.Head(url)\n\tdefer resp.Body.Close()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// (defer statement belongs here)\n\nThis checker helps uncover latent nil dereference bugs by reporting a\ndiagnostic for such mistakes.",
   284  							Default: "true",
   285  						},
   286  						{
   287  							Name:    "\"ifaceassert\"",
   288  							Doc:     "detect impossible interface-to-interface type assertions\n\nThis checker flags type assertions v.(T) and corresponding type-switch cases\nin which the static type V of v is an interface that cannot possibly implement\nthe target interface T. This occurs when V and T contain methods with the same\nname but different signatures. Example:\n\n\tvar v interface {\n\t\tRead()\n\t}\n\t_ = v.(io.Reader)\n\nThe Read method in v has a different signature than the Read method in\nio.Reader, so this assertion cannot succeed.\n",
   289  							Default: "true",
   290  						},
   291  						{
   292  							Name:    "\"infertypeargs\"",
   293  							Doc:     "check for unnecessary type arguments in call expressions\n\nExplicit type arguments may be omitted from call expressions if they can be\ninferred from function arguments, or from other type arguments:\n\n\tfunc f[T any](T) {}\n\t\n\tfunc _() {\n\t\tf[string](\"foo\") // string could be inferred\n\t}\n",
   294  							Default: "true",
   295  						},
   296  						{
   297  							Name:    "\"loopclosure\"",
   298  							Doc:     "check references to loop variables from within nested functions\n\nThis analyzer checks for references to loop variables from within a\nfunction literal inside the loop body. It checks only instances where\nthe function literal is called in a defer or go statement that is the\nlast statement in the loop body, as otherwise we would need whole\nprogram analysis.\n\nFor example:\n\n\tfor i, v := range s {\n\t\tgo func() {\n\t\t\tprintln(i, v) // not what you might expect\n\t\t}()\n\t}\n\nSee: https://golang.org/doc/go_faq.html#closures_and_goroutines",
   299  							Default: "true",
   300  						},
   301  						{
   302  							Name:    "\"lostcancel\"",
   303  							Doc:     "check cancel func returned by context.WithCancel is called\n\nThe cancellation function returned by context.WithCancel, WithTimeout,\nand WithDeadline must be called or the new context will remain live\nuntil its parent context is cancelled.\n(The background context is never cancelled.)",
   304  							Default: "true",
   305  						},
   306  						{
   307  							Name:    "\"nilfunc\"",
   308  							Doc:     "check for useless comparisons between functions and nil\n\nA useless comparison is one like f == nil as opposed to f() == nil.",
   309  							Default: "true",
   310  						},
   311  						{
   312  							Name:    "\"nilness\"",
   313  							Doc:     "check for redundant or impossible nil comparisons\n\nThe nilness checker inspects the control-flow graph of each function in\na package and reports nil pointer dereferences, degenerate nil\npointers, and panics with nil values. A degenerate comparison is of the form\nx==nil or x!=nil where x is statically known to be nil or non-nil. These are\noften a mistake, especially in control flow related to errors. Panics with nil\nvalues are checked because they are not detectable by\n\n\tif r := recover(); r != nil {\n\nThis check reports conditions such as:\n\n\tif f == nil { // impossible condition (f is a function)\n\t}\n\nand:\n\n\tp := &v\n\t...\n\tif p != nil { // tautological condition\n\t}\n\nand:\n\n\tif p == nil {\n\t\tprint(*p) // nil dereference\n\t}\n\nand:\n\n\tif p == nil {\n\t\tpanic(p)\n\t}\n",
   314  							Default: "false",
   315  						},
   316  						{
   317  							Name:    "\"printf\"",
   318  							Doc:     "check consistency of Printf format strings and arguments\n\nThe check applies to known functions (for example, those in package fmt)\nas well as any detected wrappers of known functions.\n\nA function that wants to avail itself of printf checking but is not\nfound by this analyzer's heuristics (for example, due to use of\ndynamic calls) can insert a bogus call:\n\n\tif false {\n\t\t_ = fmt.Sprintf(format, args...) // enable printf checking\n\t}\n\nThe -funcs flag specifies a comma-separated list of names of additional\nknown formatting functions or methods. If the name contains a period,\nit must denote a specific function using one of the following forms:\n\n\tdir/pkg.Function\n\tdir/pkg.Type.Method\n\t(*dir/pkg.Type).Method\n\nOtherwise the name is interpreted as a case-insensitive unqualified\nidentifier such as \"errorf\". Either way, if a listed name ends in f, the\nfunction is assumed to be Printf-like, taking a format string before the\nargument list. Otherwise it is assumed to be Print-like, taking a list\nof arguments with no format string.\n",
   319  							Default: "true",
   320  						},
   321  						{
   322  							Name:    "\"shadow\"",
   323  							Doc:     "check for possible unintended shadowing of variables\n\nThis analyzer check for shadowed variables.\nA shadowed variable is a variable declared in an inner scope\nwith the same name and type as a variable in an outer scope,\nand where the outer variable is mentioned after the inner one\nis declared.\n\n(This definition can be refined; the module generates too many\nfalse positives and is not yet enabled by default.)\n\nFor example:\n\n\tfunc BadRead(f *os.File, buf []byte) error {\n\t\tvar err error\n\t\tfor {\n\t\t\tn, err := f.Read(buf) // shadows the function variable 'err'\n\t\t\tif err != nil {\n\t\t\t\tbreak // causes return of wrong value\n\t\t\t}\n\t\t\tfoo(buf)\n\t\t}\n\t\treturn err\n\t}\n",
   324  							Default: "false",
   325  						},
   326  						{
   327  							Name:    "\"shift\"",
   328  							Doc:     "check for shifts that equal or exceed the width of the integer",
   329  							Default: "true",
   330  						},
   331  						{
   332  							Name:    "\"simplifycompositelit\"",
   333  							Doc:     "check for composite literal simplifications\n\nAn array, slice, or map composite literal of the form:\n\t[]T{T{}, T{}}\nwill be simplified to:\n\t[]T{{}, {}}\n\nThis is one of the simplifications that \"gofmt -s\" applies.",
   334  							Default: "true",
   335  						},
   336  						{
   337  							Name:    "\"simplifyrange\"",
   338  							Doc:     "check for range statement simplifications\n\nA range of the form:\n\tfor x, _ = range v {...}\nwill be simplified to:\n\tfor x = range v {...}\n\nA range of the form:\n\tfor _ = range v {...}\nwill be simplified to:\n\tfor range v {...}\n\nThis is one of the simplifications that \"gofmt -s\" applies.",
   339  							Default: "true",
   340  						},
   341  						{
   342  							Name:    "\"simplifyslice\"",
   343  							Doc:     "check for slice simplifications\n\nA slice expression of the form:\n\ts[a:len(s)]\nwill be simplified to:\n\ts[a:]\n\nThis is one of the simplifications that \"gofmt -s\" applies.",
   344  							Default: "true",
   345  						},
   346  						{
   347  							Name:    "\"sortslice\"",
   348  							Doc:     "check the argument type of sort.Slice\n\nsort.Slice requires an argument of a slice type. Check that\nthe interface{} value passed to sort.Slice is actually a slice.",
   349  							Default: "true",
   350  						},
   351  						{
   352  							Name:    "\"stdmethods\"",
   353  							Doc:     "check signature of methods of well-known interfaces\n\nSometimes a type may be intended to satisfy an interface but may fail to\ndo so because of a mistake in its method signature.\nFor example, the result of this WriteTo method should be (int64, error),\nnot error, to satisfy io.WriterTo:\n\n\ttype myWriterTo struct{...}\n        func (myWriterTo) WriteTo(w io.Writer) error { ... }\n\nThis check ensures that each method whose name matches one of several\nwell-known interface methods from the standard library has the correct\nsignature for that interface.\n\nChecked method names include:\n\tFormat GobEncode GobDecode MarshalJSON MarshalXML\n\tPeek ReadByte ReadFrom ReadRune Scan Seek\n\tUnmarshalJSON UnreadByte UnreadRune WriteByte\n\tWriteTo\n",
   354  							Default: "true",
   355  						},
   356  						{
   357  							Name:    "\"stringintconv\"",
   358  							Doc:     "check for string(int) conversions\n\nThis checker flags conversions of the form string(x) where x is an integer\n(but not byte or rune) type. Such conversions are discouraged because they\nreturn the UTF-8 representation of the Unicode code point x, and not a decimal\nstring representation of x as one might expect. Furthermore, if x denotes an\ninvalid code point, the conversion cannot be statically rejected.\n\nFor conversions that intend on using the code point, consider replacing them\nwith string(rune(x)). Otherwise, strconv.Itoa and its equivalents return the\nstring representation of the value in the desired base.\n",
   359  							Default: "true",
   360  						},
   361  						{
   362  							Name:    "\"structtag\"",
   363  							Doc:     "check that struct field tags conform to reflect.StructTag.Get\n\nAlso report certain struct tags (json, xml) used with unexported fields.",
   364  							Default: "true",
   365  						},
   366  						{
   367  							Name:    "\"testinggoroutine\"",
   368  							Doc:     "report calls to (*testing.T).Fatal from goroutines started by a test.\n\nFunctions that abruptly terminate a test, such as the Fatal, Fatalf, FailNow, and\nSkip{,f,Now} methods of *testing.T, must be called from the test goroutine itself.\nThis checker detects calls to these functions that occur within a goroutine\nstarted by the test. For example:\n\nfunc TestFoo(t *testing.T) {\n    go func() {\n        t.Fatal(\"oops\") // error: (*T).Fatal called from non-test goroutine\n    }()\n}\n",
   369  							Default: "true",
   370  						},
   371  						{
   372  							Name:    "\"tests\"",
   373  							Doc:     "check for common mistaken usages of tests and examples\n\nThe tests checker walks Test, Benchmark and Example functions checking\nmalformed names, wrong signatures and examples documenting non-existent\nidentifiers.\n\nPlease see the documentation for package testing in golang.org/pkg/testing\nfor the conventions that are enforced for Tests, Benchmarks, and Examples.",
   374  							Default: "true",
   375  						},
   376  						{
   377  							Name:    "\"unmarshal\"",
   378  							Doc:     "report passing non-pointer or non-interface values to unmarshal\n\nThe unmarshal analysis reports calls to functions such as json.Unmarshal\nin which the argument type is not a pointer or an interface.",
   379  							Default: "true",
   380  						},
   381  						{
   382  							Name:    "\"unreachable\"",
   383  							Doc:     "check for unreachable code\n\nThe unreachable analyzer finds statements that execution can never reach\nbecause they are preceded by an return statement, a call to panic, an\ninfinite loop, or similar constructs.",
   384  							Default: "true",
   385  						},
   386  						{
   387  							Name:    "\"unsafeptr\"",
   388  							Doc:     "check for invalid conversions of uintptr to unsafe.Pointer\n\nThe unsafeptr analyzer reports likely incorrect uses of unsafe.Pointer\nto convert integers to pointers. A conversion from uintptr to\nunsafe.Pointer is invalid if it implies that there is a uintptr-typed\nword in memory that holds a pointer value, because that word will be\ninvisible to stack copying and to the garbage collector.",
   389  							Default: "true",
   390  						},
   391  						{
   392  							Name:    "\"unusedparams\"",
   393  							Doc:     "check for unused parameters of functions\n\nThe unusedparams analyzer checks functions to see if there are\nany parameters that are not being used.\n\nTo reduce false positives it ignores:\n- methods\n- parameters that do not have a name or are underscored\n- functions in test files\n- functions with empty bodies or those with just a return stmt",
   394  							Default: "false",
   395  						},
   396  						{
   397  							Name:    "\"unusedresult\"",
   398  							Doc:     "check for unused results of calls to some functions\n\nSome functions like fmt.Errorf return a result and have no side effects,\nso it is always a mistake to discard the result. This analyzer reports\ncalls to certain functions in which the result of the call is ignored.\n\nThe set of functions may be controlled using flags.",
   399  							Default: "true",
   400  						},
   401  						{
   402  							Name:    "\"unusedwrite\"",
   403  							Doc:     "checks for unused writes\n\nThe analyzer reports instances of writes to struct fields and\narrays that are never read. Specifically, when a struct object\nor an array is copied, its elements are copied implicitly by\nthe compiler, and any element write to this copy does nothing\nwith the original object.\n\nFor example:\n\n\ttype T struct { x int }\n\tfunc f(input []T) {\n\t\tfor i, v := range input {  // v is a copy\n\t\t\tv.x = i  // unused write to field x\n\t\t}\n\t}\n\nAnother example is about non-pointer receiver:\n\n\ttype T struct { x int }\n\tfunc (t T) f() {  // t is a copy\n\t\tt.x = i  // unused write to field x\n\t}\n",
   404  							Default: "false",
   405  						},
   406  						{
   407  							Name:    "\"useany\"",
   408  							Doc:     "check for constraints that could be simplified to \"any\"",
   409  							Default: "false",
   410  						},
   411  						{
   412  							Name:    "\"fillreturns\"",
   413  							Doc:     "suggest fixes for errors due to an incorrect number of return values\n\nThis checker provides suggested fixes for type errors of the\ntype \"wrong number of return values (want %d, got %d)\". For example:\n\tfunc m() (int, string, *bool, error) {\n\t\treturn\n\t}\nwill turn into\n\tfunc m() (int, string, *bool, error) {\n\t\treturn 0, \"\", nil, nil\n\t}\n\nThis functionality is similar to https://github.com/sqs/goreturns.\n",
   414  							Default: "true",
   415  						},
   416  						{
   417  							Name:    "\"nonewvars\"",
   418  							Doc:     "suggested fixes for \"no new vars on left side of :=\"\n\nThis checker provides suggested fixes for type errors of the\ntype \"no new vars on left side of :=\". For example:\n\tz := 1\n\tz := 2\nwill turn into\n\tz := 1\n\tz = 2\n",
   419  							Default: "true",
   420  						},
   421  						{
   422  							Name:    "\"noresultvalues\"",
   423  							Doc:     "suggested fixes for unexpected return values\n\nThis checker provides suggested fixes for type errors of the\ntype \"no result values expected\" or \"too many return values\".\nFor example:\n\tfunc z() { return nil }\nwill turn into\n\tfunc z() { return }\n",
   424  							Default: "true",
   425  						},
   426  						{
   427  							Name:    "\"undeclaredname\"",
   428  							Doc:     "suggested fixes for \"undeclared name: <>\"\n\nThis checker provides suggested fixes for type errors of the\ntype \"undeclared name: <>\". It will either insert a new statement,\nsuch as:\n\n\"<> := \"\n\nor a new function declaration, such as:\n\nfunc <>(inferred parameters) {\n\tpanic(\"implement me!\")\n}\n",
   429  							Default: "true",
   430  						},
   431  						{
   432  							Name:    "\"fillstruct\"",
   433  							Doc:     "note incomplete struct initializations\n\nThis analyzer provides diagnostics for any struct literals that do not have\nany fields initialized. Because the suggested fix for this analysis is\nexpensive to compute, callers should compute it separately, using the\nSuggestedFix function below.\n",
   434  							Default: "true",
   435  						},
   436  						{
   437  							Name:    "\"stubmethods\"",
   438  							Doc:     "stub methods analyzer\n\nThis analyzer generates method stubs for concrete types\nin order to implement a target interface",
   439  							Default: "true",
   440  						},
   441  					},
   442  				},
   443  				Default:   "{}",
   444  				Hierarchy: "ui.diagnostic",
   445  			},
   446  			{
   447  				Name:      "staticcheck",
   448  				Type:      "bool",
   449  				Doc:       "staticcheck enables additional analyses from staticcheck.io.\n",
   450  				Default:   "false",
   451  				Status:    "experimental",
   452  				Hierarchy: "ui.diagnostic",
   453  			},
   454  			{
   455  				Name: "annotations",
   456  				Type: "map[string]bool",
   457  				Doc:  "annotations specifies the various kinds of optimization diagnostics\nthat should be reported by the gc_details command.\n",
   458  				EnumKeys: EnumKeys{
   459  					ValueType: "bool",
   460  					Keys: []EnumKey{
   461  						{
   462  							Name:    "\"bounds\"",
   463  							Doc:     "`\"bounds\"` controls bounds checking diagnostics.\n",
   464  							Default: "true",
   465  						},
   466  						{
   467  							Name:    "\"escape\"",
   468  							Doc:     "`\"escape\"` controls diagnostics about escape choices.\n",
   469  							Default: "true",
   470  						},
   471  						{
   472  							Name:    "\"inline\"",
   473  							Doc:     "`\"inline\"` controls diagnostics about inlining choices.\n",
   474  							Default: "true",
   475  						},
   476  						{
   477  							Name:    "\"nil\"",
   478  							Doc:     "`\"nil\"` controls nil checks.\n",
   479  							Default: "true",
   480  						},
   481  					},
   482  				},
   483  				Default:   "{\"bounds\":true,\"escape\":true,\"inline\":true,\"nil\":true}",
   484  				Status:    "experimental",
   485  				Hierarchy: "ui.diagnostic",
   486  			},
   487  			{
   488  				Name:      "diagnosticsDelay",
   489  				Type:      "time.Duration",
   490  				Doc:       "diagnosticsDelay controls the amount of time that gopls waits\nafter the most recent file modification before computing deep diagnostics.\nSimple diagnostics (parsing and type-checking) are always run immediately\non recently modified packages.\n\nThis option must be set to a valid duration string, for example `\"250ms\"`.\n",
   491  				Default:   "\"250ms\"",
   492  				Status:    "advanced",
   493  				Hierarchy: "ui.diagnostic",
   494  			},
   495  			{
   496  				Name:      "experimentalWatchedFileDelay",
   497  				Type:      "time.Duration",
   498  				Doc:       "experimentalWatchedFileDelay controls the amount of time that gopls waits\nfor additional workspace/didChangeWatchedFiles notifications to arrive,\nbefore processing all such notifications in a single batch. This is\nintended for use by LSP clients that don't support their own batching of\nfile system notifications.\n\nThis option must be set to a valid duration string, for example `\"100ms\"`.\n",
   499  				Default:   "\"0s\"",
   500  				Status:    "experimental",
   501  				Hierarchy: "ui.diagnostic",
   502  			},
   503  			{
   504  				Name: "codelenses",
   505  				Type: "map[string]bool",
   506  				Doc:  "codelenses overrides the enabled/disabled state of code lenses. See the\n\"Code Lenses\" section of the\n[Settings page](https://github.com/golang/tools/blob/master/gopls/doc/settings.md#code-lenses)\nfor the list of supported lenses.\n\nExample Usage:\n\n```json5\n\"gopls\": {\n...\n  \"codelenses\": {\n    \"generate\": false,  // Don't show the `go generate` lens.\n    \"gc_details\": true  // Show a code lens toggling the display of gc's choices.\n  }\n...\n}\n```\n",
   507  				EnumKeys: EnumKeys{
   508  					ValueType: "bool",
   509  					Keys: []EnumKey{
   510  						{
   511  							Name:    "\"gc_details\"",
   512  							Doc:     "Toggle the calculation of gc annotations.",
   513  							Default: "false",
   514  						},
   515  						{
   516  							Name:    "\"generate\"",
   517  							Doc:     "Runs `go generate` for a given directory.",
   518  							Default: "true",
   519  						},
   520  						{
   521  							Name:    "\"regenerate_cgo\"",
   522  							Doc:     "Regenerates cgo definitions.",
   523  							Default: "true",
   524  						},
   525  						{
   526  							Name:    "\"test\"",
   527  							Doc:     "Runs `go test` for a specific set of test or benchmark functions.",
   528  							Default: "false",
   529  						},
   530  						{
   531  							Name:    "\"tidy\"",
   532  							Doc:     "Runs `go mod tidy` for a module.",
   533  							Default: "true",
   534  						},
   535  						{
   536  							Name:    "\"upgrade_dependency\"",
   537  							Doc:     "Upgrades a dependency in the go.mod file for a module.",
   538  							Default: "true",
   539  						},
   540  						{
   541  							Name:    "\"vendor\"",
   542  							Doc:     "Runs `go mod vendor` for a module.",
   543  							Default: "true",
   544  						},
   545  					},
   546  				},
   547  				Default:   "{\"gc_details\":false,\"generate\":true,\"regenerate_cgo\":true,\"tidy\":true,\"upgrade_dependency\":true,\"vendor\":true}",
   548  				Hierarchy: "ui",
   549  			},
   550  			{
   551  				Name:      "semanticTokens",
   552  				Type:      "bool",
   553  				Doc:       "semanticTokens controls whether the LSP server will send\nsemantic tokens to the client.\n",
   554  				Default:   "false",
   555  				Status:    "experimental",
   556  				Hierarchy: "ui",
   557  			},
   558  			{
   559  				Name:      "local",
   560  				Type:      "string",
   561  				Doc:       "local is the equivalent of the `goimports -local` flag, which puts\nimports beginning with this string after third-party packages. It should\nbe the prefix of the import path whose imports should be grouped\nseparately.\n",
   562  				Default:   "\"\"",
   563  				Hierarchy: "formatting",
   564  			},
   565  			{
   566  				Name:      "gofumpt",
   567  				Type:      "bool",
   568  				Doc:       "gofumpt indicates if we should run gofumpt formatting.\n",
   569  				Default:   "false",
   570  				Hierarchy: "formatting",
   571  			},
   572  			{
   573  				Name:    "verboseOutput",
   574  				Type:    "bool",
   575  				Doc:     "verboseOutput enables additional debug logging.\n",
   576  				Default: "false",
   577  				Status:  "debug",
   578  			},
   579  		},
   580  	},
   581  	Commands: []*CommandJSON{
   582  		{
   583  			Command: "gopls.add_dependency",
   584  			Title:   "Add a dependency",
   585  			Doc:     "Adds a dependency to the go.mod file for a module.",
   586  			ArgDoc:  "{\n\t// The go.mod file URI.\n\t\"URI\": string,\n\t// Additional args to pass to the go command.\n\t\"GoCmdArgs\": []string,\n\t// Whether to add a require directive.\n\t\"AddRequire\": bool,\n}",
   587  		},
   588  		{
   589  			Command: "gopls.add_import",
   590  			Title:   "Add an import",
   591  			Doc:     "Ask the server to add an import path to a given Go file.  The method will\ncall applyEdit on the client so that clients don't have to apply the edit\nthemselves.",
   592  			ArgDoc:  "{\n\t// ImportPath is the target import path that should\n\t// be added to the URI file\n\t\"ImportPath\": string,\n\t// URI is the file that the ImportPath should be\n\t// added to\n\t\"URI\": string,\n}",
   593  		},
   594  		{
   595  			Command: "gopls.apply_fix",
   596  			Title:   "Apply a fix",
   597  			Doc:     "Applies a fix to a region of source code.",
   598  			ArgDoc:  "{\n\t// The fix to apply.\n\t\"Fix\": string,\n\t// The file URI for the document to fix.\n\t\"URI\": string,\n\t// The document range to scan for fixes.\n\t\"Range\": {\n\t\t\"start\": {\n\t\t\t\"line\": uint32,\n\t\t\t\"character\": uint32,\n\t\t},\n\t\t\"end\": {\n\t\t\t\"line\": uint32,\n\t\t\t\"character\": uint32,\n\t\t},\n\t},\n}",
   599  		},
   600  		{
   601  			Command: "gopls.check_upgrades",
   602  			Title:   "Check for upgrades",
   603  			Doc:     "Checks for module upgrades.",
   604  			ArgDoc:  "{\n\t// The go.mod file URI.\n\t\"URI\": string,\n\t// The modules to check.\n\t\"Modules\": []string,\n}",
   605  		},
   606  		{
   607  			Command: "gopls.edit_go_directive",
   608  			Title:   "Run go mod edit -go=version",
   609  			Doc:     "Runs `go mod edit -go=version` for a module.",
   610  			ArgDoc:  "{\n\t// Any document URI within the relevant module.\n\t\"URI\": string,\n\t// The version to pass to `go mod edit -go`.\n\t\"Version\": string,\n}",
   611  		},
   612  		{
   613  			Command: "gopls.gc_details",
   614  			Title:   "Toggle gc_details",
   615  			Doc:     "Toggle the calculation of gc annotations.",
   616  			ArgDoc:  "string",
   617  		},
   618  		{
   619  			Command: "gopls.generate",
   620  			Title:   "Run go generate",
   621  			Doc:     "Runs `go generate` for a given directory.",
   622  			ArgDoc:  "{\n\t// URI for the directory to generate.\n\t\"Dir\": string,\n\t// Whether to generate recursively (go generate ./...)\n\t\"Recursive\": bool,\n}",
   623  		},
   624  		{
   625  			Command: "gopls.generate_gopls_mod",
   626  			Title:   "Generate gopls.mod",
   627  			Doc:     "(Re)generate the gopls.mod file for a workspace.",
   628  			ArgDoc:  "{\n\t// The file URI.\n\t\"URI\": string,\n}",
   629  		},
   630  		{
   631  			Command: "gopls.go_get_package",
   632  			Title:   "go get a package",
   633  			Doc:     "Runs `go get` to fetch a package.",
   634  			ArgDoc:  "{\n\t// Any document URI within the relevant module.\n\t\"URI\": string,\n\t// The package to go get.\n\t\"Pkg\": string,\n\t\"AddRequire\": bool,\n}",
   635  		},
   636  		{
   637  			Command:   "gopls.list_imports",
   638  			Title:     "List imports of a file and its package",
   639  			Doc:       "Retrieve a list of imports in the given Go file, and the package it\nbelongs to.",
   640  			ArgDoc:    "{\n\t// The file URI.\n\t\"URI\": string,\n}",
   641  			ResultDoc: "{\n\t// Imports is a list of imports in the requested file.\n\t\"Imports\": []{\n\t\t\"Path\": string,\n\t\t\"Name\": string,\n\t},\n\t// PackageImports is a list of all imports in the requested file's package.\n\t\"PackageImports\": []{\n\t\t\"Path\": string,\n\t},\n}",
   642  		},
   643  		{
   644  			Command:   "gopls.list_known_packages",
   645  			Title:     "List known packages",
   646  			Doc:       "Retrieve a list of packages that are importable from the given URI.",
   647  			ArgDoc:    "{\n\t// The file URI.\n\t\"URI\": string,\n}",
   648  			ResultDoc: "{\n\t// Packages is a list of packages relative\n\t// to the URIArg passed by the command request.\n\t// In other words, it omits paths that are already\n\t// imported or cannot be imported due to compiler\n\t// restrictions.\n\t\"Packages\": []string,\n}",
   649  		},
   650  		{
   651  			Command: "gopls.regenerate_cgo",
   652  			Title:   "Regenerate cgo",
   653  			Doc:     "Regenerates cgo definitions.",
   654  			ArgDoc:  "{\n\t// The file URI.\n\t\"URI\": string,\n}",
   655  		},
   656  		{
   657  			Command: "gopls.remove_dependency",
   658  			Title:   "Remove a dependency",
   659  			Doc:     "Removes a dependency from the go.mod file of a module.",
   660  			ArgDoc:  "{\n\t// The go.mod file URI.\n\t\"URI\": string,\n\t// The module path to remove.\n\t\"ModulePath\": string,\n\t\"OnlyDiagnostic\": bool,\n}",
   661  		},
   662  		{
   663  			Command: "gopls.run_tests",
   664  			Title:   "Run test(s)",
   665  			Doc:     "Runs `go test` for a specific set of test or benchmark functions.",
   666  			ArgDoc:  "{\n\t// The test file containing the tests to run.\n\t\"URI\": string,\n\t// Specific test names to run, e.g. TestFoo.\n\t\"Tests\": []string,\n\t// Specific benchmarks to run, e.g. BenchmarkFoo.\n\t\"Benchmarks\": []string,\n}",
   667  		},
   668  		{
   669  			Command:   "gopls.run_vulncheck_exp",
   670  			Title:     "Run vulncheck (experimental)",
   671  			Doc:       "Run vulnerability check (`govulncheck`).",
   672  			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}",
   673  			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\": [][]github.com/powerman/golang-tools/internal/lsp/command.StackEntry,\n\t},\n}",
   674  		},
   675  		{
   676  			Command:   "gopls.start_debugging",
   677  			Title:     "Start the gopls debug server",
   678  			Doc:       "Start the gopls debug server if it isn't running, and return the debug\naddress.",
   679  			ArgDoc:    "{\n\t// Optional: the address (including port) for the debug server to listen on.\n\t// If not provided, the debug server will bind to \"localhost:0\", and the\n\t// full debug URL will be contained in the result.\n\t// \n\t// If there is more than one gopls instance along the serving path (i.e. you\n\t// are using a daemon), each gopls instance will attempt to start debugging.\n\t// If Addr specifies a port, only the daemon will be able to bind to that\n\t// port, and each intermediate gopls instance will fail to start debugging.\n\t// For this reason it is recommended not to specify a port (or equivalently,\n\t// to specify \":0\").\n\t// \n\t// If the server was already debugging this field has no effect, and the\n\t// result will contain the previously configured debug URL(s).\n\t\"Addr\": string,\n}",
   680  			ResultDoc: "{\n\t// The URLs to use to access the debug servers, for all gopls instances in\n\t// the serving path. For the common case of a single gopls instance (i.e. no\n\t// daemon), this will be exactly one address.\n\t// \n\t// In the case of one or more gopls instances forwarding the LSP to a daemon,\n\t// URLs will contain debug addresses for each server in the serving path, in\n\t// serving order. The daemon debug address will be the last entry in the\n\t// slice. If any intermediate gopls instance fails to start debugging, no\n\t// error will be returned but the debug URL for that server in the URLs slice\n\t// will be empty.\n\t\"URLs\": []string,\n}",
   681  		},
   682  		{
   683  			Command: "gopls.test",
   684  			Title:   "Run test(s) (legacy)",
   685  			Doc:     "Runs `go test` for a specific set of test or benchmark functions.",
   686  			ArgDoc:  "string,\n[]string,\n[]string",
   687  		},
   688  		{
   689  			Command: "gopls.tidy",
   690  			Title:   "Run go mod tidy",
   691  			Doc:     "Runs `go mod tidy` for a module.",
   692  			ArgDoc:  "{\n\t// The file URIs.\n\t\"URIs\": []string,\n}",
   693  		},
   694  		{
   695  			Command: "gopls.toggle_gc_details",
   696  			Title:   "Toggle gc_details",
   697  			Doc:     "Toggle the calculation of gc annotations.",
   698  			ArgDoc:  "{\n\t// The file URI.\n\t\"URI\": string,\n}",
   699  		},
   700  		{
   701  			Command: "gopls.update_go_sum",
   702  			Title:   "Update go.sum",
   703  			Doc:     "Updates the go.sum file for a module.",
   704  			ArgDoc:  "{\n\t// The file URIs.\n\t\"URIs\": []string,\n}",
   705  		},
   706  		{
   707  			Command: "gopls.upgrade_dependency",
   708  			Title:   "Upgrade a dependency",
   709  			Doc:     "Upgrades a dependency in the go.mod file for a module.",
   710  			ArgDoc:  "{\n\t// The go.mod file URI.\n\t\"URI\": string,\n\t// Additional args to pass to the go command.\n\t\"GoCmdArgs\": []string,\n\t// Whether to add a require directive.\n\t\"AddRequire\": bool,\n}",
   711  		},
   712  		{
   713  			Command: "gopls.vendor",
   714  			Title:   "Run go mod vendor",
   715  			Doc:     "Runs `go mod vendor` for a module.",
   716  			ArgDoc:  "{\n\t// The file URI.\n\t\"URI\": string,\n}",
   717  		},
   718  	},
   719  	Lenses: []*LensJSON{
   720  		{
   721  			Lens:  "gc_details",
   722  			Title: "Toggle gc_details",
   723  			Doc:   "Toggle the calculation of gc annotations.",
   724  		},
   725  		{
   726  			Lens:  "generate",
   727  			Title: "Run go generate",
   728  			Doc:   "Runs `go generate` for a given directory.",
   729  		},
   730  		{
   731  			Lens:  "regenerate_cgo",
   732  			Title: "Regenerate cgo",
   733  			Doc:   "Regenerates cgo definitions.",
   734  		},
   735  		{
   736  			Lens:  "test",
   737  			Title: "Run test(s) (legacy)",
   738  			Doc:   "Runs `go test` for a specific set of test or benchmark functions.",
   739  		},
   740  		{
   741  			Lens:  "tidy",
   742  			Title: "Run go mod tidy",
   743  			Doc:   "Runs `go mod tidy` for a module.",
   744  		},
   745  		{
   746  			Lens:  "upgrade_dependency",
   747  			Title: "Upgrade a dependency",
   748  			Doc:   "Upgrades a dependency in the go.mod file for a module.",
   749  		},
   750  		{
   751  			Lens:  "vendor",
   752  			Title: "Run go mod vendor",
   753  			Doc:   "Runs `go mod vendor` for a module.",
   754  		},
   755  	},
   756  	Analyzers: []*AnalyzerJSON{
   757  		{
   758  			Name:    "asmdecl",
   759  			Doc:     "report mismatches between assembly files and Go declarations",
   760  			Default: true,
   761  		},
   762  		{
   763  			Name:    "assign",
   764  			Doc:     "check for useless assignments\n\nThis checker reports assignments of the form x = x or a[i] = a[i].\nThese are almost always useless, and even when they aren't they are\nusually a mistake.",
   765  			Default: true,
   766  		},
   767  		{
   768  			Name:    "atomic",
   769  			Doc:     "check for common mistakes using the sync/atomic package\n\nThe atomic checker looks for assignment statements of the form:\n\n\tx = atomic.AddUint64(&x, 1)\n\nwhich are not atomic.",
   770  			Default: true,
   771  		},
   772  		{
   773  			Name:    "atomicalign",
   774  			Doc:     "check for non-64-bits-aligned arguments to sync/atomic functions",
   775  			Default: true,
   776  		},
   777  		{
   778  			Name:    "bools",
   779  			Doc:     "check for common mistakes involving boolean operators",
   780  			Default: true,
   781  		},
   782  		{
   783  			Name:    "buildtag",
   784  			Doc:     "check that +build tags are well-formed and correctly located",
   785  			Default: true,
   786  		},
   787  		{
   788  			Name:    "cgocall",
   789  			Doc:     "detect some violations of the cgo pointer passing rules\n\nCheck for invalid cgo pointer passing.\nThis looks for code that uses cgo to call C code passing values\nwhose types are almost always invalid according to the cgo pointer\nsharing rules.\nSpecifically, it warns about attempts to pass a Go chan, map, func,\nor slice to C, either directly, or via a pointer, array, or struct.",
   790  			Default: true,
   791  		},
   792  		{
   793  			Name:    "composites",
   794  			Doc:     "check for unkeyed composite literals\n\nThis analyzer reports a diagnostic for composite literals of struct\ntypes imported from another package that do not use the field-keyed\nsyntax. Such literals are fragile because the addition of a new field\n(even if unexported) to the struct will cause compilation to fail.\n\nAs an example,\n\n\terr = &net.DNSConfigError{err}\n\nshould be replaced by:\n\n\terr = &net.DNSConfigError{Err: err}\n",
   795  			Default: true,
   796  		},
   797  		{
   798  			Name:    "copylocks",
   799  			Doc:     "check for locks erroneously passed by value\n\nInadvertently copying a value containing a lock, such as sync.Mutex or\nsync.WaitGroup, may cause both copies to malfunction. Generally such\nvalues should be referred to through a pointer.",
   800  			Default: true,
   801  		},
   802  		{
   803  			Name:    "deepequalerrors",
   804  			Doc:     "check for calls of reflect.DeepEqual on error values\n\nThe deepequalerrors checker looks for calls of the form:\n\n    reflect.DeepEqual(err1, err2)\n\nwhere err1 and err2 are errors. Using reflect.DeepEqual to compare\nerrors is discouraged.",
   805  			Default: true,
   806  		},
   807  		{
   808  			Name:    "errorsas",
   809  			Doc:     "report passing non-pointer or non-error values to errors.As\n\nThe errorsas analysis reports calls to errors.As where the type\nof the second argument is not a pointer to a type implementing error.",
   810  			Default: true,
   811  		},
   812  		{
   813  			Name: "fieldalignment",
   814  			Doc:  "find structs that would use less memory if their fields were sorted\n\nThis analyzer find structs that can be rearranged to use less memory, and provides\na suggested edit with the optimal order.\n\nNote that there are two different diagnostics reported. One checks struct size,\nand the other reports \"pointer bytes\" used. Pointer bytes is how many bytes of the\nobject that the garbage collector has to potentially scan for pointers, for example:\n\n\tstruct { uint32; string }\n\nhave 16 pointer bytes because the garbage collector has to scan up through the string's\ninner pointer.\n\n\tstruct { string; *uint32 }\n\nhas 24 pointer bytes because it has to scan further through the *uint32.\n\n\tstruct { string; uint32 }\n\nhas 8 because it can stop immediately after the string pointer.\n",
   815  		},
   816  		{
   817  			Name:    "httpresponse",
   818  			Doc:     "check for mistakes using HTTP responses\n\nA common mistake when using the net/http package is to defer a function\ncall to close the http.Response Body before checking the error that\ndetermines whether the response is valid:\n\n\tresp, err := http.Head(url)\n\tdefer resp.Body.Close()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// (defer statement belongs here)\n\nThis checker helps uncover latent nil dereference bugs by reporting a\ndiagnostic for such mistakes.",
   819  			Default: true,
   820  		},
   821  		{
   822  			Name:    "ifaceassert",
   823  			Doc:     "detect impossible interface-to-interface type assertions\n\nThis checker flags type assertions v.(T) and corresponding type-switch cases\nin which the static type V of v is an interface that cannot possibly implement\nthe target interface T. This occurs when V and T contain methods with the same\nname but different signatures. Example:\n\n\tvar v interface {\n\t\tRead()\n\t}\n\t_ = v.(io.Reader)\n\nThe Read method in v has a different signature than the Read method in\nio.Reader, so this assertion cannot succeed.\n",
   824  			Default: true,
   825  		},
   826  		{
   827  			Name:    "infertypeargs",
   828  			Doc:     "check for unnecessary type arguments in call expressions\n\nExplicit type arguments may be omitted from call expressions if they can be\ninferred from function arguments, or from other type arguments:\n\n\tfunc f[T any](T) {}\n\t\n\tfunc _() {\n\t\tf[string](\"foo\") // string could be inferred\n\t}\n",
   829  			Default: true,
   830  		},
   831  		{
   832  			Name:    "loopclosure",
   833  			Doc:     "check references to loop variables from within nested functions\n\nThis analyzer checks for references to loop variables from within a\nfunction literal inside the loop body. It checks only instances where\nthe function literal is called in a defer or go statement that is the\nlast statement in the loop body, as otherwise we would need whole\nprogram analysis.\n\nFor example:\n\n\tfor i, v := range s {\n\t\tgo func() {\n\t\t\tprintln(i, v) // not what you might expect\n\t\t}()\n\t}\n\nSee: https://golang.org/doc/go_faq.html#closures_and_goroutines",
   834  			Default: true,
   835  		},
   836  		{
   837  			Name:    "lostcancel",
   838  			Doc:     "check cancel func returned by context.WithCancel is called\n\nThe cancellation function returned by context.WithCancel, WithTimeout,\nand WithDeadline must be called or the new context will remain live\nuntil its parent context is cancelled.\n(The background context is never cancelled.)",
   839  			Default: true,
   840  		},
   841  		{
   842  			Name:    "nilfunc",
   843  			Doc:     "check for useless comparisons between functions and nil\n\nA useless comparison is one like f == nil as opposed to f() == nil.",
   844  			Default: true,
   845  		},
   846  		{
   847  			Name: "nilness",
   848  			Doc:  "check for redundant or impossible nil comparisons\n\nThe nilness checker inspects the control-flow graph of each function in\na package and reports nil pointer dereferences, degenerate nil\npointers, and panics with nil values. A degenerate comparison is of the form\nx==nil or x!=nil where x is statically known to be nil or non-nil. These are\noften a mistake, especially in control flow related to errors. Panics with nil\nvalues are checked because they are not detectable by\n\n\tif r := recover(); r != nil {\n\nThis check reports conditions such as:\n\n\tif f == nil { // impossible condition (f is a function)\n\t}\n\nand:\n\n\tp := &v\n\t...\n\tif p != nil { // tautological condition\n\t}\n\nand:\n\n\tif p == nil {\n\t\tprint(*p) // nil dereference\n\t}\n\nand:\n\n\tif p == nil {\n\t\tpanic(p)\n\t}\n",
   849  		},
   850  		{
   851  			Name:    "printf",
   852  			Doc:     "check consistency of Printf format strings and arguments\n\nThe check applies to known functions (for example, those in package fmt)\nas well as any detected wrappers of known functions.\n\nA function that wants to avail itself of printf checking but is not\nfound by this analyzer's heuristics (for example, due to use of\ndynamic calls) can insert a bogus call:\n\n\tif false {\n\t\t_ = fmt.Sprintf(format, args...) // enable printf checking\n\t}\n\nThe -funcs flag specifies a comma-separated list of names of additional\nknown formatting functions or methods. If the name contains a period,\nit must denote a specific function using one of the following forms:\n\n\tdir/pkg.Function\n\tdir/pkg.Type.Method\n\t(*dir/pkg.Type).Method\n\nOtherwise the name is interpreted as a case-insensitive unqualified\nidentifier such as \"errorf\". Either way, if a listed name ends in f, the\nfunction is assumed to be Printf-like, taking a format string before the\nargument list. Otherwise it is assumed to be Print-like, taking a list\nof arguments with no format string.\n",
   853  			Default: true,
   854  		},
   855  		{
   856  			Name: "shadow",
   857  			Doc:  "check for possible unintended shadowing of variables\n\nThis analyzer check for shadowed variables.\nA shadowed variable is a variable declared in an inner scope\nwith the same name and type as a variable in an outer scope,\nand where the outer variable is mentioned after the inner one\nis declared.\n\n(This definition can be refined; the module generates too many\nfalse positives and is not yet enabled by default.)\n\nFor example:\n\n\tfunc BadRead(f *os.File, buf []byte) error {\n\t\tvar err error\n\t\tfor {\n\t\t\tn, err := f.Read(buf) // shadows the function variable 'err'\n\t\t\tif err != nil {\n\t\t\t\tbreak // causes return of wrong value\n\t\t\t}\n\t\t\tfoo(buf)\n\t\t}\n\t\treturn err\n\t}\n",
   858  		},
   859  		{
   860  			Name:    "shift",
   861  			Doc:     "check for shifts that equal or exceed the width of the integer",
   862  			Default: true,
   863  		},
   864  		{
   865  			Name:    "simplifycompositelit",
   866  			Doc:     "check for composite literal simplifications\n\nAn array, slice, or map composite literal of the form:\n\t[]T{T{}, T{}}\nwill be simplified to:\n\t[]T{{}, {}}\n\nThis is one of the simplifications that \"gofmt -s\" applies.",
   867  			Default: true,
   868  		},
   869  		{
   870  			Name:    "simplifyrange",
   871  			Doc:     "check for range statement simplifications\n\nA range of the form:\n\tfor x, _ = range v {...}\nwill be simplified to:\n\tfor x = range v {...}\n\nA range of the form:\n\tfor _ = range v {...}\nwill be simplified to:\n\tfor range v {...}\n\nThis is one of the simplifications that \"gofmt -s\" applies.",
   872  			Default: true,
   873  		},
   874  		{
   875  			Name:    "simplifyslice",
   876  			Doc:     "check for slice simplifications\n\nA slice expression of the form:\n\ts[a:len(s)]\nwill be simplified to:\n\ts[a:]\n\nThis is one of the simplifications that \"gofmt -s\" applies.",
   877  			Default: true,
   878  		},
   879  		{
   880  			Name:    "sortslice",
   881  			Doc:     "check the argument type of sort.Slice\n\nsort.Slice requires an argument of a slice type. Check that\nthe interface{} value passed to sort.Slice is actually a slice.",
   882  			Default: true,
   883  		},
   884  		{
   885  			Name:    "stdmethods",
   886  			Doc:     "check signature of methods of well-known interfaces\n\nSometimes a type may be intended to satisfy an interface but may fail to\ndo so because of a mistake in its method signature.\nFor example, the result of this WriteTo method should be (int64, error),\nnot error, to satisfy io.WriterTo:\n\n\ttype myWriterTo struct{...}\n        func (myWriterTo) WriteTo(w io.Writer) error { ... }\n\nThis check ensures that each method whose name matches one of several\nwell-known interface methods from the standard library has the correct\nsignature for that interface.\n\nChecked method names include:\n\tFormat GobEncode GobDecode MarshalJSON MarshalXML\n\tPeek ReadByte ReadFrom ReadRune Scan Seek\n\tUnmarshalJSON UnreadByte UnreadRune WriteByte\n\tWriteTo\n",
   887  			Default: true,
   888  		},
   889  		{
   890  			Name:    "stringintconv",
   891  			Doc:     "check for string(int) conversions\n\nThis checker flags conversions of the form string(x) where x is an integer\n(but not byte or rune) type. Such conversions are discouraged because they\nreturn the UTF-8 representation of the Unicode code point x, and not a decimal\nstring representation of x as one might expect. Furthermore, if x denotes an\ninvalid code point, the conversion cannot be statically rejected.\n\nFor conversions that intend on using the code point, consider replacing them\nwith string(rune(x)). Otherwise, strconv.Itoa and its equivalents return the\nstring representation of the value in the desired base.\n",
   892  			Default: true,
   893  		},
   894  		{
   895  			Name:    "structtag",
   896  			Doc:     "check that struct field tags conform to reflect.StructTag.Get\n\nAlso report certain struct tags (json, xml) used with unexported fields.",
   897  			Default: true,
   898  		},
   899  		{
   900  			Name:    "testinggoroutine",
   901  			Doc:     "report calls to (*testing.T).Fatal from goroutines started by a test.\n\nFunctions that abruptly terminate a test, such as the Fatal, Fatalf, FailNow, and\nSkip{,f,Now} methods of *testing.T, must be called from the test goroutine itself.\nThis checker detects calls to these functions that occur within a goroutine\nstarted by the test. For example:\n\nfunc TestFoo(t *testing.T) {\n    go func() {\n        t.Fatal(\"oops\") // error: (*T).Fatal called from non-test goroutine\n    }()\n}\n",
   902  			Default: true,
   903  		},
   904  		{
   905  			Name:    "tests",
   906  			Doc:     "check for common mistaken usages of tests and examples\n\nThe tests checker walks Test, Benchmark and Example functions checking\nmalformed names, wrong signatures and examples documenting non-existent\nidentifiers.\n\nPlease see the documentation for package testing in golang.org/pkg/testing\nfor the conventions that are enforced for Tests, Benchmarks, and Examples.",
   907  			Default: true,
   908  		},
   909  		{
   910  			Name:    "unmarshal",
   911  			Doc:     "report passing non-pointer or non-interface values to unmarshal\n\nThe unmarshal analysis reports calls to functions such as json.Unmarshal\nin which the argument type is not a pointer or an interface.",
   912  			Default: true,
   913  		},
   914  		{
   915  			Name:    "unreachable",
   916  			Doc:     "check for unreachable code\n\nThe unreachable analyzer finds statements that execution can never reach\nbecause they are preceded by an return statement, a call to panic, an\ninfinite loop, or similar constructs.",
   917  			Default: true,
   918  		},
   919  		{
   920  			Name:    "unsafeptr",
   921  			Doc:     "check for invalid conversions of uintptr to unsafe.Pointer\n\nThe unsafeptr analyzer reports likely incorrect uses of unsafe.Pointer\nto convert integers to pointers. A conversion from uintptr to\nunsafe.Pointer is invalid if it implies that there is a uintptr-typed\nword in memory that holds a pointer value, because that word will be\ninvisible to stack copying and to the garbage collector.",
   922  			Default: true,
   923  		},
   924  		{
   925  			Name: "unusedparams",
   926  			Doc:  "check for unused parameters of functions\n\nThe unusedparams analyzer checks functions to see if there are\nany parameters that are not being used.\n\nTo reduce false positives it ignores:\n- methods\n- parameters that do not have a name or are underscored\n- functions in test files\n- functions with empty bodies or those with just a return stmt",
   927  		},
   928  		{
   929  			Name:    "unusedresult",
   930  			Doc:     "check for unused results of calls to some functions\n\nSome functions like fmt.Errorf return a result and have no side effects,\nso it is always a mistake to discard the result. This analyzer reports\ncalls to certain functions in which the result of the call is ignored.\n\nThe set of functions may be controlled using flags.",
   931  			Default: true,
   932  		},
   933  		{
   934  			Name: "unusedwrite",
   935  			Doc:  "checks for unused writes\n\nThe analyzer reports instances of writes to struct fields and\narrays that are never read. Specifically, when a struct object\nor an array is copied, its elements are copied implicitly by\nthe compiler, and any element write to this copy does nothing\nwith the original object.\n\nFor example:\n\n\ttype T struct { x int }\n\tfunc f(input []T) {\n\t\tfor i, v := range input {  // v is a copy\n\t\t\tv.x = i  // unused write to field x\n\t\t}\n\t}\n\nAnother example is about non-pointer receiver:\n\n\ttype T struct { x int }\n\tfunc (t T) f() {  // t is a copy\n\t\tt.x = i  // unused write to field x\n\t}\n",
   936  		},
   937  		{
   938  			Name: "useany",
   939  			Doc:  "check for constraints that could be simplified to \"any\"",
   940  		},
   941  		{
   942  			Name:    "fillreturns",
   943  			Doc:     "suggest fixes for errors due to an incorrect number of return values\n\nThis checker provides suggested fixes for type errors of the\ntype \"wrong number of return values (want %d, got %d)\". For example:\n\tfunc m() (int, string, *bool, error) {\n\t\treturn\n\t}\nwill turn into\n\tfunc m() (int, string, *bool, error) {\n\t\treturn 0, \"\", nil, nil\n\t}\n\nThis functionality is similar to https://github.com/sqs/goreturns.\n",
   944  			Default: true,
   945  		},
   946  		{
   947  			Name:    "nonewvars",
   948  			Doc:     "suggested fixes for \"no new vars on left side of :=\"\n\nThis checker provides suggested fixes for type errors of the\ntype \"no new vars on left side of :=\". For example:\n\tz := 1\n\tz := 2\nwill turn into\n\tz := 1\n\tz = 2\n",
   949  			Default: true,
   950  		},
   951  		{
   952  			Name:    "noresultvalues",
   953  			Doc:     "suggested fixes for unexpected return values\n\nThis checker provides suggested fixes for type errors of the\ntype \"no result values expected\" or \"too many return values\".\nFor example:\n\tfunc z() { return nil }\nwill turn into\n\tfunc z() { return }\n",
   954  			Default: true,
   955  		},
   956  		{
   957  			Name:    "undeclaredname",
   958  			Doc:     "suggested fixes for \"undeclared name: <>\"\n\nThis checker provides suggested fixes for type errors of the\ntype \"undeclared name: <>\". It will either insert a new statement,\nsuch as:\n\n\"<> := \"\n\nor a new function declaration, such as:\n\nfunc <>(inferred parameters) {\n\tpanic(\"implement me!\")\n}\n",
   959  			Default: true,
   960  		},
   961  		{
   962  			Name:    "fillstruct",
   963  			Doc:     "note incomplete struct initializations\n\nThis analyzer provides diagnostics for any struct literals that do not have\nany fields initialized. Because the suggested fix for this analysis is\nexpensive to compute, callers should compute it separately, using the\nSuggestedFix function below.\n",
   964  			Default: true,
   965  		},
   966  		{
   967  			Name:    "stubmethods",
   968  			Doc:     "stub methods analyzer\n\nThis analyzer generates method stubs for concrete types\nin order to implement a target interface",
   969  			Default: true,
   970  		},
   971  	},
   972  }