Hello World in GO language

Introduction

From now on, I would like to summarize what I did as a memorandum when learning the GO language. There are quite a few things I want to try using the GO language, so I'm studying from scratch. (Isn't cryptanalysis really cool?) I think it will be slow to update because it will be a study that takes place between studies, but I would like to do it little by little. I would appreciate it if you could let me know if you made a mistake.

Let's do it!

Development environment

・ Notebook PC ・ Windows 10 ・ Visual Studio Code ・ GO ver.1.15.2

I'm using

Hello World! Output

The contents of the program look like this

hello.go


package main

import "fmt"

func main() {
	fmt.Println("Hello World!")
}

//Execution method
>go run hello.go
//Hello World!Is output, OK

The concept of modules and the definition of functions are similar to how to write in other languages. It feels like they are united.

A brief introduction to each part

package: Magic. Instead, GO seems to have to belong to some package in every program, that declaration. In this program, it belongs to the package "main", and the main function belonging to the main package is executed immediately after the program runs.

import: Used when using the one included in another package. "Fmt" seems to be a print package, which allows you to use Print () and Printf (). The import declaration comes after the package declaration

func: Here is the definition of the main function

that's all.

Recommended Posts

Hello World in GO language
Programming language in "Hello World"
Hello World with gRPC / go in Docker environment
Hello world with full features of Go language
Hello world
I got an error when trying to run Hello World in Go language
Try implementing Yubaba in Go language
Let's do "Hello World" in 40 languages! !!
Use optinal type-like in Go language
Post to slack in Go language
cout << "Hello, World! \ N" in python
Hello World in Flask [Appropriate memo]
Code: 2 "Hello World" in "Choregraphe-Python script"
Write tests in GO language + gin
Do something object-oriented in GO language
Pymacs hello world
Hello world instead of localhost in Django
How to display Hello world in python
cython hello world
Java programmer touched Go language (Implement Java inheritance in Go language)
I wrote the hexagonal architecture in go language
Create a web server in Go language (net/http) (2)
Write Pulumi in Go
web2py memo: Hello World
Go language learning record
Go language environment construction
hello world with ctypes
RabbitMQ Tutorial 1 ("Hello World!")
Hello, World with Docker
Go language cheat sheet
Features of Go language
Hello World on Django
Django's first Hello World
Hello world with flask
[Programming learning] Logic comparison by language part.1 ("Hello World")
Create a web server in Go language (net / http) (1)
Go language to see and remember Part 7 C language in GO language
Machine language embedding in C language
Display "Hello World" created in the local environment on the web
[Go language] How to get terminal input in real time
Draw hello world with mod_wsgi
Hello World with Flask + Hamlish
Until hello world with zappa
Implement recursive closures in Go
go language learning miscellaneous notes 1
[Golang] About Go language channel
Hello World in various languages [Python / PHP / Java / Perl / Ruby]
Hello World (beginners) on Django
Python starting with Hello world!
Getting Started with Heroku-Viewing Hello World in Python Django with Raspberry PI 3
Created a package to support AWS Lambda development in Go language
Created gomi, a trash can tool for rm in Go language
Read the config file in Go language! Introducing a simple sample
Programming to fight in the world ~ 5-1
Programming to fight in the world ~ 5-5,5-6
Programming to fight in the world 5-3
Multi-instance module test in C language
Hello, world! With virtual CAN communication
100 Language Processing Knock Chapter 1 in Python
Introduction to TensorFlow --Hello World Edition
Hello world! (Minimum Viable Block Chain)