Fix Go get_latest_version

pull/986/head
Jasper van Merle 6 years ago
parent 0529f80870
commit 5ac8d55ed6

@ -25,13 +25,8 @@ module Docs
HTML HTML
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('https://golang.org/pkg/', opts) doc = fetch_doc('https://golang.org/project/', opts)
doc.at_css('#page ul > li > a').text[3..-1]
footer = doc.at_css('#footer').content
version = footer.scan(/go([0-9.]+)/)[0][0]
version = version[0...-1] if version.end_with?('.')
version
end end
private private

Loading…
Cancel
Save