added Magazine Subscribers

This commit is contained in:
John O'Keefe 2023-12-20 22:01:29 -05:00
parent 6bcbe63df5
commit 984bfa9ae1

View File

@ -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)
}