> For the complete documentation index, see [llms.txt](https://www.scriptchildie.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.scriptchildie.com/malware-development-in-golang-introduction/golang-programming-intro/2.-hello-world.md).

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.scriptchildie.com/malware-development-in-golang-introduction/golang-programming-intro/2.-hello-world.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
