package tools import "regexp" // CheckID 验证id是否为非负正整数。 func CheckID(id string) bool { if id == "1" { return false } pattern := `^[1-9]\d*$` reg := regexp.MustCompile(pattern) return reg.MatchString(id) }