Home > Article > Backend Development > Is There a URL for the Latest Stable Go Release That Works with Ansible Scripts?
Obtain the URL for the Latest Stable Go Release
In the realm of software development, maintaining up-to-date dependencies is crucial. With Go, it's imperative to locate the URL pointing to the most recent stable Linux binary release.
The Question
An Ansible script requires the ability to automatically download and install the latest stable Go version. However, the official Go download site (https://golang.org/dl/) only provides specific release versions. The question arises: is there a permanent URL resembling "https://dl.google.com/go/latest.linux-amd64.tar.gz" to facilitate this task?
The Answer
Rejoice, for there is an elegant solution to this query. The command below will fetch the latest stable Go version in a single operation:
wget "https://dl.google.com/go/$(curl https://go.dev/VERSION?m=text).linux-amd64.tar.gz"
This command assuredly downloads the latest stable Go binary for your Linux-based system.
The above is the detailed content of Is There a URL for the Latest Stable Go Release That Works with Ansible Scripts?. For more information, please follow other related articles on the PHP Chinese website!