コード例 #1
0
ファイル: tgdzWin.go プロジェクト: jmdkina/jkgowindows
func (t *tgdzWindow) giveResult() {
	year, _ := strconv.Atoi(t.inputYear.Text())
	if tgdz.CalTGDZ(year) == "" {
		t.outputResult.SetText("sb 不要乱写")
	} else {
		result := t.inputYear.Text() + " 是 " + tgdz.CalTGDZ(year) + " 年"
		t.outputResult.SetText(result)
	}
}
コード例 #2
0
ファイル: tgdz_test.go プロジェクト: jmdkina/jkgowindows
func TestCalTGDZ(t *testing.T) {
	year := 2010
	//fmt.Scanf("%d", &year)
	yearN := tgdz.CalTGDZ(year)
	if yearN == "" {
		t.Errorf("Error year [%d]\n", yearN)
		return
	}
	fmt.Printf("%d 是 %s 年!", year, yearN)
}