Environment construction, Build -Go edition-

About Go

The Go language (Golang) is rapidly gaining popularity as a statically typed programming language.

1. Installation

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.

2. Actually build the code

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

Environment construction, Build -Go edition-
Go language environment construction
Build a go environment using Docker
[Python3] Development environment construction << Windows edition >>
Django environment construction
DeepIE3D environment construction
Emacs-based environment construction
Linux environment construction
Environment construction (python)
CodeIgniter environment construction
Python --Environment construction
Python environment construction
Golang environment construction
python environment construction
Word2vec environment construction
Environment construction with VSCode + Remote Container (Go / Application)
Go (Echo) Go Modules × Build development environment with Docker
Environment construction: GCP + Docker
Django project environment construction
python windows environment construction
ConoHa environment construction memo
homebrew python environment construction
PyData related environment construction
Anaconda-4.2.0-python3 environment construction (Mac)
Python development environment construction
YOLO v4 environment construction ①
pyenv + fish environment construction
python2.7 development environment construction
BigGorilla environment construction memo
grip environment construction onCentOS6.5
Anaconda environment construction memo
Golang environment construction [goenv]
Mac environment construction Python
Pyxel environment construction (Mac)
Python environment construction @ Win7
Install Python3 on Mac and build environment [Definitive Edition]
[Go + Gin] I tried to build a Docker environment
[Ubuntu 18.04] Tensorflow 2.0.0-GPU environment construction
Python + Anaconda + Pycharm environment construction
About Linux environment construction (CentOS)
Handle Go environment variables (viper)
[Go] Execution / build / package test
Anaconda environment construction on CentOS7
Django development environment construction memo
Build an Anaconda virtual environment
Build a Go development environment with VS Code's Remote Containers
Python environment construction (Windows10 + Emacs)
Build a LAMP environment [CentOS 7]
[Memo] Construction of cygwin environment
Build python3 environment with ubuntu 16.04
ML environment construction with Miniconda
Python environment construction For Mac
Build Python environment on Windows
Anaconda3 × Pycharm environment construction memo
Build python environment with direnv
Python3 environment construction (for beginners)
Python environment construction and TensorFlow
[ev3dev × Python] Build ev3dev development environment
NumPy and matplotlib environment construction
Build python environment on windows
Machine learning environment construction macbook 2021