# 2. Hello World

To make sure that everything is running as expected let's write a quick "hello world" program.&#x20;

&#x20;Create a new folder where the project will live and run the following command:

```
go mod init helloWorld
```

Running the command will create the [go.mod](https://go.dev/doc/modules/gomod-ref) file.

We then have to create a `main.go` file in the same directory.

The hello world code is shown below:&#x20;

{% code title="main.go" %}

```go
package main

import "fmt"

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

}

```

{% endcode %}

To simply run the code, navigate to the same directory as `main.go` and execute:

```
go run .
```

To build it as a stand alone executable simply run

```
go build .
```

The beauty of go unlike other languages is that it will figure out all dependencies and packages used. No need to download them separately.
