@@ -18,7 +18,6 @@ import (
18
18
"golang.org/x/tools/gopls/internal/label"
19
19
"golang.org/x/tools/gopls/internal/protocol"
20
20
"golang.org/x/tools/gopls/internal/protocol/command"
21
- "golang.org/x/tools/gopls/internal/util/moreslices"
22
21
"golang.org/x/tools/internal/event"
23
22
"golang.org/x/tools/internal/memoize"
24
23
)
@@ -381,8 +380,8 @@ func (s *Snapshot) matchErrorToModule(pm *ParsedModule, goCmdError string) (prot
381
380
var reference * modfile.Line
382
381
matches := moduleVersionInErrorRe .FindAllStringSubmatch (goCmdError , - 1 )
383
382
384
- for _ , match := range moreslices . Reversed (matches ) {
385
- ver := module.Version {Path : match [ 1 ], Version : match [2 ]}
383
+ for i := len (matches ) - 1 ; i >= 0 ; i -- {
384
+ ver := module.Version {Path : matches [ i ][ 1 ], Version : matches [ i ] [2 ]}
386
385
if err := module .Check (ver .Path , ver .Version ); err != nil {
387
386
continue
388
387
}
@@ -413,8 +412,8 @@ func (s *Snapshot) matchErrorToModule(pm *ParsedModule, goCmdError string) (prot
413
412
func (s * Snapshot ) goCommandDiagnostic (pm * ParsedModule , loc protocol.Location , goCmdError string ) (* Diagnostic , error ) {
414
413
matches := moduleVersionInErrorRe .FindAllStringSubmatch (goCmdError , - 1 )
415
414
var innermost * module.Version
416
- for _ , match := range moreslices . Reversed (matches ) {
417
- ver := module.Version {Path : match [ 1 ], Version : match [2 ]}
415
+ for i := len (matches ) - 1 ; i >= 0 ; i -- {
416
+ ver := module.Version {Path : matches [ i ][ 1 ], Version : matches [ i ] [2 ]}
418
417
if err := module .Check (ver .Path , ver .Version ); err != nil {
419
418
continue
420
419
}
0 commit comments