[Tutorial] Learning Golang with examples – Example 1: Hello World

Tram Ho

Go by Example

In the first program, we will print out the classic message: “Hello world”. This is the full source code:

To run the program, write the code in the file hello-world.go and use go run.

Sometimes we want to build our program into a binary file. This can be done using go build.

Then we run the file directly:

Now we can build and run a basic Go application. Learn more with the next examples.

The next example: Values

Source: https://github.com/nhannguyen09cntt/gobyexample/tree/master/examples/hello-world

Refer: https://4rum.vn/t/tutorial-go-by-example-hello-world/500 https://github.com/mmcgrana/gobyexample

Share the news now

Source : Viblo