From 984bfa9ae15ffa7ef17e5c015213585bd7f37153 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Wed, 20 Dec 2023 22:01:29 -0500 Subject: [PATCH] added Magazine Subscribers --- playground/magazineSubscribers.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 playground/magazineSubscribers.go diff --git a/playground/magazineSubscribers.go b/playground/magazineSubscribers.go new file mode 100644 index 0000000..693368e --- /dev/null +++ b/playground/magazineSubscribers.go @@ -0,0 +1,22 @@ +// from chapter 8 of head first go +package main + +import "fmt" + +type subscriberType struct { + name string + rate float64 + active bool +} + +func magazineSubscribers() { + + var subscriber subscriberType + + subscriber.name = "Aman Singh" + subscriber.rate = 4.99 + subscriber.active = true + fmt.Println("Name:", subscriber.name) + fmt.Println("Monthly rate:", subscriber.rate) + fmt.Println("Active?:", subscriber.active) +}