Shell alias to get latest go versions?

48 views
Skip to first unread message

Steve Mynott

unread,
Jan 14, 2020, 4:22:31 AM1/14/20
to golang-nuts
Does anyone have a simple shell alias, function or similar to get the
latest released versions of go?

Is there a cleaner way of going this than screen scraping the website
or looking at tags in git?

--
Steve Mynott <steve....@gmail.com>
cv25519/ECF8B611205B447E091246AF959E3D6197190DD5

Paul Jolly

unread,
Jan 14, 2020, 4:37:39 AM1/14/20
to Steve Mynott, golang-nuts
I think you're after something like (for your OS/arch):

wget https://dl.google.com/go/$(curl -s
https://golang.org/dl/?mode=json | jq -r
.[0].version).linux-amd64.tar.gz

The JSON mode of the download page being the key here.
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CANuZA8R2j8_0pgbNw13qAq82dTJonCsXgnNS0vhKD_dxzwhwfw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages