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 @@
1module Docs1module Docs
2 class Go < UrlScraper2 class Go < UrlScraper
3 self.type = 'go'3 self.type = 'go'
4 self.release = '1.17.2'4 self.release = '1.17.5'
5 self.base_url = 'https://golang.org/pkg/'5 self.base_url = 'https://golang.org/pkg/'
6 self.links = {6 self.links = {
7 home: 'https://golang.org/',7 home: 'https://golang.org/',
@@ -10,9 +10,9 @@ module Docs · 2 unmodified lines
10 10
11 # Run godoc locally, since https://golang.org/pkg/ redirects to https://pkg.go.dev/std with rate limiting / scraping protection.11 # Run godoc locally, since https://golang.org/pkg/ redirects to https://pkg.go.dev/std with rate limiting / scraping protection.
12 12
13 # curl -LO https://golang.org/dl/go1.17.2.windows-amd64.zip13 # curl -LO https://golang.org/dl/go1.17.5.windows-amd64.zip
14 # go install golang.org/x/tools/cmd/godoc@latest14 # go install golang.org/x/tools/cmd/godoc@latest
15 # go/bin/godoc -zip=go1.17.2.windows-amd64.zip -goroot=/go15 # go/bin/godoc -zip=go1.17.5.windows-amd64.zip -goroot=/go
16 self.base_url = 'http://localhost:6060/pkg/'16 self.base_url = 'http://localhost:6060/pkg/'
17 17
18 html_filters.push 'clean_local_urls'18 html_filters.push 'clean_local_urls'
@@ -34,8 +34,8 @@ module Docs · 15 unmodified lines
34 HTML34 HTML
35 35
36 def get_latest_version(opts)36 def get_latest_version(opts)
37 doc = fetch_doc('https://golang.org/project/', opts)37 doc = fetch_doc('https://go.dev/dl/', opts)
38 doc.at_css('#page ul > li > a').text[3..-1]38 doc.at_css('.download[href]')['href'][/go1[0-9.]+[0-9]/][2..]
39 end39 end
40 40
41 private41 private