trying_out_go/playground/magazineSubscribers.go

23 lines
415 B
Go
Raw Normal View History

2023-12-20 22:01:29 -05:00
// 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)
}