From f5135b3f12e97b1b75f5355d6ba40b98986673e1 Mon Sep 17 00:00:00 2001 From: Boukabouya Date: Sat, 30 Dec 2023 14:00:33 +0100 Subject: [PATCH] Array --- hello/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hello/main.go b/hello/main.go index 8ab932f..bdbf56f 100644 --- a/hello/main.go +++ b/hello/main.go @@ -5,5 +5,15 @@ import ( ) func main() { - fmt.Println("Hello from Go!") + var colors = [3]string{"Green", "red", "blue"} + /*colors[0] = "Red" + colors[1] = "Green" + colors[2] = "Blue"*/ + fmt.Println(colors) + fmt.Println(colors[0]) + var numbers = [5]int{5, 4, 8, 6, 1} + fmt.Println(numbers) + + fmt.Println("Number of colors :", len(colors)) + fmt.Println("Number of numbers :", len(numbers)) }