@@ -15,7 +15,6 @@ package main
15
15
import (
16
16
"bytes"
17
17
"encoding/json"
18
- "errors"
19
18
"flag"
20
19
"fmt"
21
20
"io"
@@ -24,7 +23,6 @@ import (
24
23
"os"
25
24
"os/exec"
26
25
"path/filepath"
27
- "regexp"
28
26
"sort"
29
27
"strings"
30
28
@@ -237,12 +235,6 @@ func main() {
237
235
if err != nil {
238
236
log .Fatal (err )
239
237
}
240
- // Due to https://github.com/golang/vscode-go/issues/1682, we cannot use
241
- // pseudo-version as the pinned version reliably.
242
- dlvRevOrStable := dlvVersion .Version
243
- if rev , err := pseudoVersionRev (dlvVersion .Version ); err == nil { // pseudo-version
244
- dlvRevOrStable = rev
245
- }
246
238
247
239
// Check for the latest gopls version.
248
240
versions , err := listAllModuleVersions ("golang.org/x/tools/gopls" )
@@ -277,7 +269,7 @@ func main() {
277
269
}
278
270
279
271
// TODO(suzmue): change input to json and avoid magic string printing.
280
- toolsString := fmt .Sprintf (string (data ), goplsVersion .Version , goplsVersion .Time [:len ("YYYY-MM-DD" )], goplsVersionPre .Version , goplsVersionPre .Time [:len ("YYYY-MM-DD" )], dlvRevOrStable , dlvVersion .Version , dlvVersion .Time [:len ("YYYY-MM-DD" )])
272
+ toolsString := fmt .Sprintf (string (data ), goplsVersion .Version , goplsVersion .Time [:len ("YYYY-MM-DD" )], goplsVersionPre .Version , goplsVersionPre .Time [:len ("YYYY-MM-DD" )], dlvVersion .Version , dlvVersion .Time [:len ("YYYY-MM-DD" )])
281
273
282
274
// Write tools section.
283
275
b .WriteString (toolsString )
@@ -693,19 +685,3 @@ func describeDebugProperty(p *Property) string {
693
685
}
694
686
return b .String ()
695
687
}
696
-
697
- // pseudoVersionRev extracts the revision info if the given version is pseudo version.
698
- // We wanted to use golang.org/x/mod/module.PseudoVersionRev, but couldn't due to
699
- // an error in the CI. This is a workaround.
700
- //
701
- // It assumes the version string came from the proxy, so a valid, canonical version
702
- // string. Thus, the check for pseudoversion is not as robust as golang.org/x/mod/module
703
- // offers.
704
- func pseudoVersionRev (ver string ) (rev string , _ error ) {
705
- var pseudoVersionRE = regexp .MustCompile (`^v[0-9]+\.(0\.0-|\d+\.\d+-([^+]*\.)?0\.)\d{14}-[A-Za-z0-9]+(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$` )
706
- if strings .Count (ver , "-" ) < 2 || ! pseudoVersionRE .MatchString (ver ) {
707
- return "" , errors .New ("not a pseudo version" )
708
- }
709
- j := strings .LastIndex (ver , "-" )
710
- return ver [j + 1 :], nil
711
- }
0 commit comments