1 import "strconv" 2 3 func IsLeapYear(y string) bool { //y == 2000, 2004 4 //判断是否为闰年 5 year, _ := strconv.Atoi(y) 6 if year%4 == 0 && year%100 != 0 || year%400 == 0 { 7 return true 8 } 9 10 return false 11 }