Go Data Structures
Go Data Structures
Chapter 1 : 1. Arrays
- Indexed from 0
```go
fmt.Println(arr[0]) // 1
```
Key Points:
- Length is fixed
Chapter 2 : 2. Slices
```go
fmt.Println(nums)
```
Built-in Functions:
Go Language Fundamentals
Slicing:
```go
```
Chapter 3 : 3. Maps
```go
capitals := map[string]string{
"France": "Paris",
"Italy": "Rome",
fmt.Println(capitals["Italy"])
```
Map Functions:
```go
capitals["Germany"] = "Berlin"
delete(capitals, "France")
Go Language Fundamentals
```
Chapter 4 : 4. Structs
```go
Title string
Author string
Pages int
fmt.Println(myBook.Title)
```
```go
```
Go Language Fundamentals
```go
p := &myBook
p.Pages = 250
fmt.Println(myBook.Pages) // 250
```
Chapter 6 : 6. Interfaces
```go
Area() float64
Radius float64
fmt.Println(s.Area())
```
- Simulate inheritance
```go
Name string
Animal
Breed string
```