CentOS Stream 10
Sponsored Link

Go : インストール2025/02/12

 

Go をインストールします。

[1] Go のインストールと動作確認です。
[root@dlp ~]#
dnf -y install go-toolset

Dependencies resolved.
================================================================================================================================
 Package                            Architecture             Version                          Repository                   Size
================================================================================================================================
Installing:
 go-toolset                         x86_64                   1.23.1-4.el10                    appstream                   7.3 k
Installing dependencies:
 apr                                x86_64                   1.7.5-2.el10                     appstream                   129 k
 apr-util                           x86_64                   1.6.3-21.el10                    appstream                    99 k
 delve                              x86_64                   1.22.1-5.el10                    appstream                   4.8 M
 emacs-filesystem                   noarch                   1:29.4-9.el10                    appstream                   9.9 k
 golang                             x86_64                   1.23.1-4.el10                    appstream                   669 k
 golang-bin                         x86_64                   1.23.1-4.el10                    appstream                    63 M
 golang-src                         noarch                   1.23.1-4.el10                    appstream                    12 M
 libserf                            x86_64                   1.3.10-7.el10                    appstream                    61 k
 subversion-libs                    x86_64                   1.14.3-8.el10                    appstream                   1.3 M
 utf8proc                           x86_64                   2.7.0-9.el10                     appstream                    81 k
Installing weak dependencies:
 apr-util-lmdb                      x86_64                   1.6.3-21.el10                    appstream                    15 k
 apr-util-openssl                   x86_64                   1.6.3-21.el10                    appstream                    17 k
 mercurial                          x86_64                   6.8.1-2.el10_0                   epel                        6.2 M
 subversion                         x86_64                   1.14.3-8.el10                    appstream                   1.0 M

Transaction Summary
================================================================================================================================
Install  15 Packages
.....
.....

[root@dlp ~]#
go version

go version go1.23.1 (Red Hat 1.23.1-4.el10) linux/amd64
# テストプログラムを作成して動作確認

[root@dlp ~]# cat > helloworld.go <<'EOF'
package main
import "fmt"
func main() {
    fmt.Println("Hello Go World !")
}
EOF 

[root@dlp ~]#
go run helloworld.go

Hello Go World !
# ビルドして実行

[root@dlp ~]#
go build helloworld.go

[root@dlp ~]#
./helloworld

Hello Go World !
関連コンテンツ