Go

A compiled language for simple, fast and concurrent programs

About

Go is a statically typed language from Google, built for quick builds. Concurrency is part of the design. A strong choice for command-line tools, network services or a single compiled binary.

Install it

pkg install golang

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

go run . Compile and run the program in the current folder in one step. The fastest way to try something.
go build -o app . Compile the current folder into a named binary you can run on its own.
go mod init example.com/app Start a module and create the file that records dependencies.
go get github.com/spf13/cobra Download a dependency and add it to the module.
go test ./... Run the tests in the current module and every package below it.
go fmt ./... Reformat every source file to the standard style. Keeps differences between revisions clean.

Worked example

Run go test ./... and this is what you should see.

termux
$ go test ./...
ok   example.com/app       0.412s
ok   example.com/app/util  0.201s
?    example.com/app/cmd     [no test files]

Each line is one package, with its test result and elapsed time.

Developed by

The Go team at Google .