From abb8a7ffac3ac0495a3698229774361f9efad1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Thu, 11 Jan 2024 11:36:53 +0300 Subject: [PATCH] cities example slice --- main.go | 2 +- slices/demo2.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 slices/demo2.go diff --git a/main.go b/main.go index 7d73145..0d4aa74 100644 --- a/main.go +++ b/main.go @@ -15,5 +15,5 @@ func main() { conditionals.Demo3() loops.Demo5() arrays.Demo4() - slices.Demo1() + slices.Demo2() } diff --git a/slices/demo2.go b/slices/demo2.go new file mode 100644 index 0000000..b21d1c3 --- /dev/null +++ b/slices/demo2.go @@ -0,0 +1,8 @@ +package slices + +import "fmt" + +func Demo2() { + cities := []string{"Ankara", "İstanbul", "İzmir"} // same as make + fmt.Println(cities) +} \ No newline at end of file