示例#1
0
func main() {
	alarmclock.Timer{parseSecondsFromArgs()}.Countdown()
	alarmclock.Toll()
}
示例#2
0
}

func abort(msg string) {
	fmt.Fprintf(os.Stderr, "error: %v\n", msg)
	os.Exit(1)
}

func setTeaNames(teas map[string][]int) {
	for k := range teas {
		teaNames = append(teaNames, k)
	}
}

var runTimer = func(seconds int) {
	alarmclock.Timer{seconds}.Countdown()
	alarmclock.Toll()
}

func handleError(err error) {
	if err != nil {
		abort(err.Error())
	}
	return
}

func reader() *bufio.Reader {
	return bufio.NewReader(os.Stdin)
}

func parseInt(unparsed string) (parsed int) {
	parsed, err := strconv.Atoi(strings.TrimSpace(unparsed))