added Magazine Subscribers
This commit is contained in:
parent
6bcbe63df5
commit
984bfa9ae1
22
playground/magazineSubscribers.go
Normal file
22
playground/magazineSubscribers.go
Normal 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)
|
||||
}
|
Loading…
Reference in New Issue
Block a user