blob: 60c1092ee7fcb5324aa9a3034b70d567cc57d638 [file] [log] [blame]
// +build ignore,OMIT
package main
import "fmt"
type Organ struct {
Name string
Weight Grams
}
func (o *Organ) String() string { return fmt.Sprintf("%v (%v)", o.Name, o.Weight) }
type Grams int
func (g Grams) String() string { return fmt.Sprintf("%dg", int(g)) }
func main() {
s := []*Organ{{"brain", 1340}, {"heart", 290},
{"liver", 1494}, {"pancreas", 131}, {"spleen", 162}}
for _, o := range s {
fmt.Println(o)
}
}