History

Update Go documentation (1.17.5)

Simon Legner committed 4 years ago

Commit 34579451 parent 9475ea61 file · +5 −5Browse files

Unified · Split

lib/docs/scrapers/go.rb+5−5
@@ -1,7 +1,7 @@
11 module Docs
22 class Go < UrlScraper
33 self.type = 'go'
4− self.release = '1.17.2'
4+ self.release = '1.17.5'
55 self.base_url = 'https://golang.org/pkg/'
66 self.links = {
77 home: 'https://golang.org/',
@@ -10,9 +10,9 @@ module Docs · 2 unmodified lines
1010
1111 # Run godoc locally, since https://golang.org/pkg/ redirects to https://pkg.go.dev/std with rate limiting / scraping protection.
1212
13− # curl -LO https://golang.org/dl/go1.17.2.windows-amd64.zip
13+ # curl -LO https://golang.org/dl/go1.17.5.windows-amd64.zip
1414 # go install golang.org/x/tools/cmd/godoc@latest
15− # go/bin/godoc -zip=go1.17.2.windows-amd64.zip -goroot=/go
15+ # go/bin/godoc -zip=go1.17.5.windows-amd64.zip -goroot=/go
1616 self.base_url = 'http://localhost:6060/pkg/'
1717
1818 html_filters.push 'clean_local_urls'
@@ -34,8 +34,8 @@ module Docs · 15 unmodified lines
3434 HTML
3535
3636 def get_latest_version(opts)
37− doc = fetch_doc('https://golang.org/project/', opts)
38− doc.at_css('#page ul > li > a').text[3..-1]
37+ doc = fetch_doc('https://go.dev/dl/', opts)
38+ doc.at_css('.download[href]')['href'][/go1[0-9.]+[0-9]/][2..]
3939 end
4040
4141 private