Go : Install2022/06/17 |
Install Go Language.
|
|
[1] | Install Go Language and try to run test app. |
[root@dlp ~]# dnf -y install go-toolset Dependencies resolved. ================================================================================ Package Architecture Version Repository Size ================================================================================ Installing: go-toolset x86_64 1.17.5-1.el9 appstream 5.4 k Installing dependencies: delve x86_64 1.7.3-1.el9 appstream 4.2 M golang x86_64 1.17.5-1.el9 appstream 621 k golang-bin x86_64 1.17.5-1.el9 appstream 90 M golang-src noarch 1.17.5-1.el9 appstream 9.0 M openssl-devel x86_64 1:3.0.1-18.el9 appstream 4.1 M Transaction Summary ================================================================================ Install 6 Packages ..... .....
[root@dlp ~]#
go version go version go1.17.5 linux/amd64 # verify to create test program
[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 ! # build and run [root@dlp ~]# go build helloworld.go [root@dlp ~]# ./helloworld Hello Go World ! |