package one import "fmt" const ( flip = iota split multiply ) type result struct { kind int left int right int } func (r result) String() string { var kindStr string switch r.kind { case flip: kindStr = "flip" case split: kindStr = "split" case multiply: kindStr = "multiply" } return fmt.Sprintf("kind: %s left: %d right: %d", kindStr, r.left, r.right) }