From 5ac8d55ed6fc49a0b06b08dfa24dccd19d45365d Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Fri, 19 Jul 2019 21:44:18 +0200 Subject: [PATCH] Fix Go get_latest_version --- lib/docs/scrapers/go.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/docs/scrapers/go.rb b/lib/docs/scrapers/go.rb index 8997b7b1..27b46652 100644 --- a/lib/docs/scrapers/go.rb +++ b/lib/docs/scrapers/go.rb @@ -25,13 +25,8 @@ module Docs HTML def get_latest_version(opts) - doc = fetch_doc('https://golang.org/pkg/', opts) - - footer = doc.at_css('#footer').content - version = footer.scan(/go([0-9.]+)/)[0][0] - version = version[0...-1] if version.end_with?('.') - - version + doc = fetch_doc('https://golang.org/project/', opts) + doc.at_css('#page ul > li > a').text[3..-1] end private