Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Commit

Permalink
gosrc: update Go version regexp for golang.org pages
Browse files Browse the repository at this point in the history
The golang.org website has changed its UI design, and no longer
includes "Build version <version>" text at the bottom of each page.

The build version is still specified on each page in a short script.
Use that instead.

Updates #644

Change-Id: Iedac4fa1f44510af6462f9bb3431c5c23eaaed16
Reviewed-on: https://go-review.googlesource.com/c/gddo/+/193258
Reviewed-by: Tuo Shan <[email protected]>
  • Loading branch information
dmitshur committed Sep 4, 2019
1 parent 246c193 commit 72a348e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gosrc/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

var (
golangBuildVersionRe = regexp.MustCompile(`Build version ([-+:. 0-9A-Za-z]+)`)
golangBuildVersionRe = regexp.MustCompile(`var goVersion = "([-+:. 0-9A-Za-z]+)";`)
golangFileRe = regexp.MustCompile(`<a href="([^"]+)"`)
)

Expand All @@ -30,7 +30,7 @@ func getStandardDir(ctx context.Context, client *http.Client, importPath string,

var etag string
m := golangBuildVersionRe.FindSubmatch(p)
if m == nil {
if len(m) < 2 {
return nil, errors.New("Could not find revision for " + importPath)
}
etag = strings.Trim(string(m[1]), ". ")
Expand Down

0 comments on commit 72a348e

Please sign in to comment.