trying_out_go/playground/magazineSubscribers.go

23 lines
415 B
Go

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