Go Language Fundamentals
Go Language Fundamentals
Chapter 1 : 1. Introduction to Go
compiled, and known for its simplicity, concurrency support, and fast performance.
Chapter 2 : 2. Installing Go
```go
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
```
Go Language Fundamentals
```go
age := 30
const pi = 3.14
```
If-Else
```go
if age >= 18 {
fmt.Println("Adult")
} else {
fmt.Println("Minor")
```
Go Language Fundamentals
Switch
```go
default: fmt.Println("Midweek")
```
Loops
```go
fmt.Println(i)
```
Chapter 6 : 6. Functions
```go
return a + b
```
```go
if b == 0 {
return 0, false
return a / b, true
```
```go
arr := [3]int{1, 2, 3}
slice := []int{1, 2, 3, 4}
slice = append(slice, 5)
```
Chapter 8 : 8. Maps
```go
fmt.Println(scores["Alice"])
```
Chapter 9 : 9. Structs
Go Language Fundamentals
```go
Name string
Age int
p := Person{"Yeison", 30}
fmt.Println(p.Name)
```
```go
x := 5
ptr := &x
fmt.Println(*ptr) // 5
```
```go
import "errors"
if b == 0 {
Go Language Fundamentals
return a / b, nil
```