CentOS8 標準リポジトリ上の Go は 1.11.6 と古いです。
# dnf info golang Last metadata expiration check: 0:40:22 ago on Sun Oct 27 20:00:43 2019. Available Packages Name : golang Version : 1.11.6 Release : 1.module_el8.0.0+192+8b12aa21 Arch : x86_64 Size : 637 k Source : golang-1.11.6-1.module_el8.0.0+192+8b12aa21.src.rpm Repo : AppStream Summary : The Go Programming Language URL : http://golang.org/ License : BSD and Public Domain Description : The Go Programming Language.
そこで今回は手動で最新の Go をインストールします。
インストールは簡単で、以下のように実行するだけです。
curl -LO https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz tar zxvf go1.13.3.linux-amd64.tar.gz -C /usr/local/ echo 'export GOROOT=/usr/local/go' >> ~/.bashrc echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc source /etc/profile