> For the complete documentation index, see [llms.txt](https://zeyad-abulaban.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zeyad-abulaban.gitbook.io/notes/golang-programming/variables.md).

# Variables

```go
package main

import (
	"fmt"
)

func main() {
	var i int
	i = 42
	var j int = 27
	k := 99     //Leaving the declaration for the compiler
	fmt.Printf("%T %T %T",i,j,k)
}
```

```go
package main

import (
	"fmt"
)

var (   //initalizing variables at the package level.

	i int = 1337   //No need to put "var" before them.
	j  int = 31337
	k string = "Meow"
)

func main() {
	fmt.Printf("%T, %T, %T\n", i, j, k)
}
```

## Notes

in go every variable you initialize have by default the value of 0 == false **Visibility**

* Lower case first letter for the package scope.
* Upper case flrst letter will export the variable globally.
* No private scope.

**Naming conventins**

* Pascal or camelCase (Don't use underscore or a score). -- Capiltilize acrnyms (HTTP,URL).
* As short as reasonable. --Longer names for longer lives.

**Type coversions**

* DestinationType(variable)
* Use `strconv` package for strings


---

# 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, and the optional `goal` query parameter:

```
GET https://zeyad-abulaban.gitbook.io/notes/golang-programming/variables.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
