Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions script/get-latest-go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
require 'net/http'

def go_version
res = Net::HTTP.get URI('https://go.dev/dl/')
start = res.index '/dl/go'
if start
start += '/dl/'.length
last = res.index '"', start
res[start, last- start]&.match(/go\d+\.\d+\.?\d*/)&.to_s[2..]
end
res = Net::HTTP.get URI('https://go.dev/VERSION?m=text')
res.match(/(?<=go).*/)
end

File.write('/tmp/go-version',go_version)