You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/settings.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -573,13 +573,6 @@ comprehensively test.
573
573
574
574
575
575
Default: `true`
576
-
### `build.experimentalTemplateSupport`
577
-
578
-
(Experimental) experimentalTemplateSupport opts into the experimental support
579
-
for template files.
580
-
581
-
582
-
Default: `false`
583
576
### `build.experimentalUseInvalidMetadata`
584
577
585
578
(Experimental) experimentalUseInvalidMetadata enables gopls to fall back on outdated
@@ -612,6 +605,12 @@ References and Rename will miss results in such packages.
612
605
613
606
614
607
Default: `"Normal"`
608
+
### `build.templateExtensions`
609
+
610
+
templateExtensions gives the extensions of file names that are treateed
611
+
as template files. (The extension
612
+
is the part of the file name after the final dot.)
613
+
615
614
### `formatting.gofumpt`
616
615
617
616
gofumpt indicates if we should run gofumpt formatting.
@@ -720,11 +719,11 @@ Example Usage:
720
719
|`deepequalerrors`| check for calls of reflect.DeepEqual on error values <br/> The deepequalerrors checker looks for calls of the form: <br/> reflect.DeepEqual(err1, err2) <br/> where err1 and err2 are errors. Using reflect.DeepEqual to compare errors is discouraged. <br/> Default: `true`|
721
720
|`errorsas`| report passing non-pointer or non-error values to errors.As <br/> The errorsas analysis reports calls to errors.As where the type of the second argument is not a pointer to a type implementing error. <br/> Default: `true`|
722
721
|`fieldalignment`| find structs that would use less memory if their fields were sorted <br/> This analyzer find structs that can be rearranged to use less memory, and provides a suggested edit with the optimal order. <br/> Note that there are two different diagnostics reported. One checks struct size, and the other reports "pointer bytes" used. Pointer bytes is how many bytes of the object that the garbage collector has to potentially scan for pointers, for example: <br/> <pre>struct { uint32; string }</pre><br/> have 16 pointer bytes because the garbage collector has to scan up through the string's inner pointer. <br/> <pre>struct { string; *uint32 }</pre><br/> has 24 pointer bytes because it has to scan further through the *uint32. <br/> <pre>struct { string; uint32 }</pre><br/> has 8 because it can stop immediately after the string pointer. <br/> <br/> Default: `false`|
723
-
|`fillreturns`|suggested fixes for "wrong number of return values (want %d, got %d)" <br/> This checker provides suggested fixes for type errors of the type "wrong number of return values (want %d, got %d)". For example: <pre>func m() (int, string, *bool, error) {<br/> return<br/>}</pre>will turn into <pre>func m() (int, string, *bool, error) {<br/> return 0, "", nil, nil<br/>}</pre><br/> This functionality is similar to https://github.com/sqs/goreturns. <br/> <br/> Default: `true`|
722
+
|`fillreturns`|suggest fixes for errors due to an incorrect number of return values <br/> This checker provides suggested fixes for type errors of the type "wrong number of return values (want %d, got %d)". For example: <pre>func m() (int, string, *bool, error) {<br/> return<br/>}</pre>will turn into <pre>func m() (int, string, *bool, error) {<br/> return 0, "", nil, nil<br/>}</pre><br/> This functionality is similar to https://github.com/sqs/goreturns. <br/> <br/> Default: `true`|
724
723
|`fillstruct`| note incomplete struct initializations <br/> This analyzer provides diagnostics for any struct literals that do not have any fields initialized. Because the suggested fix for this analysis is expensive to compute, callers should compute it separately, using the SuggestedFix function below. <br/> <br/> Default: `true`|
725
724
|`httpresponse`| check for mistakes using HTTP responses <br/> A common mistake when using the net/http package is to defer a function call to close the http.Response Body before checking the error that determines whether the response is valid: <br/> <pre>resp, err := http.Head(url)<br/>defer resp.Body.Close()<br/>if err != nil {<br/> log.Fatal(err)<br/>}<br/>// (defer statement belongs here)</pre><br/> This checker helps uncover latent nil dereference bugs by reporting a diagnostic for such mistakes. <br/> Default: `true`|
726
725
|`ifaceassert`| detect impossible interface-to-interface type assertions <br/> This checker flags type assertions v.(T) and corresponding type-switch cases in which the static type V of v is an interface that cannot possibly implement the target interface T. This occurs when V and T contain methods with the same name but different signatures. Example: <br/> <pre>var v interface {<br/> Read()<br/>}<br/>_ = v.(io.Reader)</pre><br/> The Read method in v has a different signature than the Read method in io.Reader, so this assertion cannot succeed. <br/> <br/> Default: `true`|
727
-
|`infertypeargs`| check for unnecessary type arguments in call expressions <br/> Explicit type arguments may be omitted from call expressions if they can be inferred from function arguments, or from other type arguments: <br/> func f[T any](T) {}<br/>func _() { <pre>f[string]("foo") // string could be inferred</pre>} <br/> <br/> Default: `true`|
726
+
|`infertypeargs`| check for unnecessary type arguments in call expressions <br/> Explicit type arguments may be omitted from call expressions if they can be inferred from function arguments, or from other type arguments: <br/> <pre>func f[T any](T) {}<br/><br/><br/>func _() {<br/> f[string]("foo") // string could be inferred<br/>}</pre><br/> <br/> Default: `true`|
728
727
|`loopclosure`| check references to loop variables from within nested functions <br/> This analyzer checks for references to loop variables from within a function literal inside the loop body. It checks only instances where the function literal is called in a defer or go statement that is the last statement in the loop body, as otherwise we would need whole program analysis. <br/> For example: <br/> <pre>for i, v := range s {<br/> go func() {<br/> println(i, v) // not what you might expect<br/> }()<br/>}</pre><br/> See: https://golang.org/doc/go_faq.html#closures_and_goroutines <br/> Default: `true`|
729
728
|`lostcancel`| check cancel func returned by context.WithCancel is called <br/> The cancellation function returned by context.WithCancel, WithTimeout, and WithDeadline must be called or the new context will remain live until its parent context is cancelled. (The background context is never cancelled.) <br/> Default: `true`|
730
729
|`nilfunc`| check for useless comparisons between functions and nil <br/> A useless comparison is one like f == nil as opposed to f() == nil. <br/> Default: `true`|
Copy file name to clipboardExpand all lines: package.json
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1999,12 +1999,6 @@
1999
1999
"default": true,
2000
2000
"scope": "resource"
2001
2001
},
2002
-
"build.experimentalTemplateSupport": {
2003
-
"type": "boolean",
2004
-
"markdownDescription": "(Experimental) experimentalTemplateSupport opts into the experimental support\nfor template files.\n",
2005
-
"default": false,
2006
-
"scope": "resource"
2007
-
},
2008
2002
"build.experimentalUseInvalidMetadata": {
2009
2003
"type": "boolean",
2010
2004
"markdownDescription": "(Experimental) 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",
@@ -2031,6 +2025,12 @@
2031
2025
"default": "Normal",
2032
2026
"scope": "resource"
2033
2027
},
2028
+
"build.templateExtensions": {
2029
+
"type": "array",
2030
+
"markdownDescription": "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",
2031
+
"default": "[\"tmpl\",\"gotmpl\"]",
2032
+
"scope": "resource"
2033
+
},
2034
2034
"formatting.gofumpt": {
2035
2035
"type": "boolean",
2036
2036
"markdownDescription": "gofumpt indicates if we should run gofumpt formatting.\n",
@@ -2186,7 +2186,7 @@
2186
2186
},
2187
2187
"fillreturns": {
2188
2188
"type": "boolean",
2189
-
"markdownDescription": "suggested fixes for \"wrong number of return values (want %d, got %d)\"\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",
2189
+
"markdownDescription": "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",
2190
2190
"default": true
2191
2191
},
2192
2192
"fillstruct": {
@@ -2206,7 +2206,7 @@
2206
2206
},
2207
2207
"infertypeargs": {
2208
2208
"type": "boolean",
2209
-
"markdownDescription": "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\nfunc f[T any](T) {}\n\nfunc _() {\n\tf[string](\"foo\") // string could be inferred\n}\n",
2209
+
"markdownDescription": "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",
0 commit comments