The Go language (Golang) is rapidly gaining popularity as a statically typed programming language.
https://golang.org/dl
Use the go command. If it is installed successfully, you will see the following result.
Go is a tool for managing Go source code.
Usage:
go <command> [arguments]
The commands are:
bug start a bug report
build compile packages and dependencies
clean remove object files and cached files
doc show documentation for package or symbol
env print Go environment information
fix update packages to use new APIs
fmt gofmt (reformat) package sources
generate generate Go files by processing source
get download and install packages and dependencies
install compile and install packages and dependencies
list list packages or modules
mod module maintenance
run compile and run Go program
test test packages
tool run specified go tool
version print Go version
vet report likely mistakes in packages
Use "go help <command>" for more information about a command.
package main
import "fmt"
func main() {
fmt.Printf("Hello World!")
}
The Go language is a compiled language, unlike interpreted languages such as PHP and perl. You must compile the file before it can be executed to make it executable.
go build hello.go
//When the compilation is complete, a file called "hello" will be created.
./hello
If you are from the web industry, you may tend to avoid Go, which is a compiled language and a statically typed language, because it is mainly an interpreted language such as PHP, Ruby, and javascript that does not require compilation. However, it is said to be a relatively easy language to learn.
Recommended Posts