mirror of https://github.com/dmarkham/enumer.git
26 lines
482 B
Go
26 lines
482 B
Go
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
type TitleCaseValue int
|
||
|
|
||
|
const (
|
||
|
titlecasevalueone TitleCaseValue = iota
|
||
|
titlecasevaluetwo
|
||
|
titlecasevaluethree
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
ck(titlecasevalueone, "Titlecasevalueone")
|
||
|
ck(titlecasevaluetwo, "Titlecasevaluetwo")
|
||
|
ck(titlecasevaluethree, "Titlecasevaluethree")
|
||
|
ck(-127, "TitleCaseValue(-127)")
|
||
|
ck(127, "TitleCaseValue(127)")
|
||
|
}
|
||
|
|
||
|
func ck(value TitleCaseValue, str string) {
|
||
|
if fmt.Sprint(value) != str {
|
||
|
panic("transform_title.go: " + str)
|
||
|
}
|
||
|
}
|