mirror of https://github.com/golang/go.git
internal/lsp: fix two more staticcheck warnings
Found by running: $ staticcheck --checks all ./internal/lsp/... And then manually checking the results. Change-Id: I6a0abf72596de6539c19bb0244860c5bd0ac8fd1 Reviewed-on: https://go-review.googlesource.com/c/tools/+/258917 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Trust: Rebecca Stambler <rstambler@golang.org> Trust: Heschi Kreinick <heschi@google.com> Run-TryBot: Rebecca Stambler <rstambler@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
af0a1b5f3c
commit
dc8b4bacda
|
|
@ -182,10 +182,9 @@ func (r *runner) Diagnostics(t *testing.T, uri span.URI, want []*source.Diagnost
|
|||
// Get the diagnostics for this view if we have not done it before.
|
||||
v := r.server.session.View(r.data.Config.Dir)
|
||||
r.collectDiagnostics(v)
|
||||
var got []*source.Diagnostic
|
||||
for _, d := range r.diagnostics[uri] {
|
||||
got = append(got, d)
|
||||
}
|
||||
d := r.diagnostics[uri]
|
||||
got := make([]*source.Diagnostic, len(d))
|
||||
copy(got, d)
|
||||
// A special case to test that there are no diagnostics for a file.
|
||||
if len(want) == 1 && want[0].Source == "no_diagnostics" {
|
||||
if len(got) != 0 {
|
||||
|
|
|
|||
|
|
@ -510,8 +510,8 @@ func (o *Options) Clone() *Options {
|
|||
return result
|
||||
}
|
||||
|
||||
func (options *Options) AddStaticcheckAnalyzer(a *analysis.Analyzer) {
|
||||
options.StaticcheckAnalyzers[a.Name] = Analyzer{Analyzer: a, Enabled: true}
|
||||
func (o *Options) AddStaticcheckAnalyzer(a *analysis.Analyzer) {
|
||||
o.StaticcheckAnalyzers[a.Name] = Analyzer{Analyzer: a, Enabled: true}
|
||||
}
|
||||
|
||||
func (o *Options) set(name string, value interface{}) OptionResult {
|
||||
|
|
|
|||
Loading…
Reference in New Issue