Go Installation On A Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian And MacOS

Go Installation On A Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian And MacOS

go

Tool for managing go source code.

Install go

  • Debian apt-get install golang-bin Click to copy
  • Ubuntu apt-get install golang-bin Click to copy
  • Alpine OS apk add go Click to copy
  • Arch Linux pacman -S go Click to copy
  • Kali Linux apt-get install golang-bin Click to copy
  • Fedora dnf install golang-bin Click to copy
  • Raspbian apt-get install golang-bin Click to copy
  • macOS brew install go Click to copy

Tool for managing go source code.

How to use go?

Below are few example commands for go that you can use in the terminal.

Download and install a package, specified by its import path:
go get package_pathClick to copy
Compile and run a source file (it has to contain a `main` package):
go run file.goClick to copy
Compile a source file into a named executable:
go build -o executable file.goClick to copy
Compile the package present in the current directory:
go buildClick to copy
Execute all test cases of the current package (files have to end with `_test.go`):
go testClick to copy
Compile and install the current package:
go installClick to copy
Install the latest version of go in Debian, Ubuntu, Alpine, Arch, Kali, Fedora, Raspbian and macOS from terminal. To install the go just copy the above command for your OS and run into terminal. After you run the command it will grab the latest version of go from the respository and install it in your computer/server.