# 07. Go Playground

{% hint style="info" %}
&#x20;The Go Playground is a web service that runs on [golang.org](https://golang.org/)'s servers.
{% endhint %}

We can use Go playground to edit and run simple Go programs. Head to playground at : <https://play.golang.org/>&#x20;

Delete existing code and type in below code manually. (Remember programming is all about muscle memory!)

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

```go
package main

import "fmt"

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

```

{% endcode %}

Let's understand how this code works:

{% hint style="success" %}
Every Go program starts execution from *main()*
{% endhint %}

```go
func main(){}
```

Main is the signal to compiler to start execution of code from *here.* This is entry point of our application.

{% hint style="success" %}
Every Go program should be part of a package
{% endhint %}

```go
package main
```

This declares that our program is part of package "main". Packages are used to bundle similar code that can be reused easily.

{% hint style="success" %}
Go program can use external packages using import
{% endhint %}

```go
import "fmt"
```

We are importing **fmt** package using import statement. Compiler will find this package and import in our program before we can use it.

We are using **Println** method from **fmt** package to print output to console. How to print output to console is implemented by fmt package, we do not have to write (re-write!) code to do it!


---

# Agent Instructions: 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://book.codewithgo.com/go-playground.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.
