diff --git a/main.go b/main.go index 10fba2d..af5adbe 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( "golesson/maps" "golesson/pointers" "golesson/slices" + "golesson/structs" "golesson/variables" ) @@ -52,4 +53,5 @@ func main() { numbers:=[]int{1,2,3} pointers.Demo2(numbers) fmt.Println("Numbers in Main", numbers[0]) + structs.Demo1() } diff --git a/structs/demo1.go b/structs/demo1.go new file mode 100644 index 0000000..54a70af --- /dev/null +++ b/structs/demo1.go @@ -0,0 +1,13 @@ +package structs + +import "fmt" + +func Demo1() { + fmt.Println(product{"Computer", 5000, "XYZ"}) +} + +type product struct { + name string + unitPrice float64 + brand string +} \ No newline at end of file