2024-01-04 07:30:51 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2024-01-10 14:05:43 +00:00
|
|
|
"golesson/arrays"
|
2024-01-04 07:30:51 +00:00
|
|
|
"golesson/conditionals"
|
2024-01-17 09:18:23 +00:00
|
|
|
"golesson/examplerange"
|
2024-01-13 21:12:27 +00:00
|
|
|
"golesson/functions"
|
2024-01-04 07:30:51 +00:00
|
|
|
"golesson/loops"
|
2024-01-15 23:25:45 +00:00
|
|
|
"golesson/maps"
|
2024-01-20 08:11:46 +00:00
|
|
|
"golesson/pointers"
|
2024-01-10 14:05:43 +00:00
|
|
|
"golesson/slices"
|
2024-01-04 07:30:51 +00:00
|
|
|
"golesson/variables"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
variables.Demo1()
|
|
|
|
fmt.Print()
|
|
|
|
conditionals.Demo3()
|
2024-01-04 15:32:09 +00:00
|
|
|
loops.Demo5()
|
2024-01-10 08:23:21 +00:00
|
|
|
arrays.Demo4()
|
2024-01-11 08:36:53 +00:00
|
|
|
slices.Demo2()
|
2024-01-13 21:33:09 +00:00
|
|
|
functions.SayHello("Mert Gör")
|
2024-01-15 23:25:45 +00:00
|
|
|
functions.Addition(2, 6)
|
|
|
|
var total = functions.Addition(3, 8)
|
2024-01-13 21:26:50 +00:00
|
|
|
fmt.Println(total)
|
2024-01-13 21:30:12 +00:00
|
|
|
fmt.Println(total * 10)
|
2024-01-15 23:25:45 +00:00
|
|
|
|
|
|
|
result1, result2, result3, result4 := functions.MathOps(10, 2)
|
2024-01-14 10:18:27 +00:00
|
|
|
fmt.Println("Add :", result1)
|
|
|
|
fmt.Println("Subtract :", result2)
|
|
|
|
fmt.Println("Multiply : ", result3)
|
|
|
|
fmt.Println("Divide : ", result4)
|
2024-01-15 23:25:45 +00:00
|
|
|
|
|
|
|
var result = functions.AddVariadic(1, 3, 4, 5, 3)
|
2024-01-14 14:29:53 +00:00
|
|
|
fmt.Println(result)
|
2024-01-14 14:31:00 +00:00
|
|
|
|
2024-01-15 23:25:45 +00:00
|
|
|
fmt.Println(functions.AddVariadic(1, 3, 4))
|
2024-01-14 14:34:18 +00:00
|
|
|
|
2024-01-15 23:25:45 +00:00
|
|
|
numbers_main := []int{1, 2, 3, 4}
|
2024-01-14 14:34:18 +00:00
|
|
|
fmt.Println(functions.AddVariadic(numbers_main...))
|
2024-01-15 23:25:45 +00:00
|
|
|
|
|
|
|
maps.Demo1()
|
2024-01-17 09:18:23 +00:00
|
|
|
examplerange.Demo1()
|
2024-01-17 09:36:24 +00:00
|
|
|
examplerange.Demo2()
|
2024-01-17 09:41:04 +00:00
|
|
|
examplerange.Demo3()
|
2024-01-20 08:11:46 +00:00
|
|
|
|
|
|
|
number := 20
|
2024-01-20 08:17:16 +00:00
|
|
|
pointers.Demo1(&number)
|
2024-01-20 08:11:46 +00:00
|
|
|
fmt.Println("Number in Main go file", number)
|
2024-01-20 08:17:16 +00:00
|
|
|
|
2024-01-04 07:30:51 +00:00
|
|
|
}
|