# Golang

## Golang

### Imports

`fmt` use `fmt.Println("Hello World")` to print stuff\
`reflect` use to inspect variable types

## structs

### structs as a type

Structs are data objects containing any types of data including other structs.\
There is no limit in nesting structs. Golang is not object oriented but has some feature of object oriented programming. Example:

```
type Starship struct {
    Name String
    class String
    weight int
    length float64
}
```

`Starship` is the name of the struct similiar to a class in object oriented programming languages

### Interfaces

### Method Sets

[Error Handling](https://earthly.dev/blog/golang-errors/)


---

# 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://lib.rjo.me/newlib/languages/golang.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.
