Add policy validation code more rigorous

This commit is contained in:
Harshavardhana
2015-02-17 13:23:13 -08:00
parent 7882c8c746
commit 980d229272
3 changed files with 121 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ func (d Date) IsZero() bool {
// Convert string date in format YYYY-MM-DD to Date.
// Leading and trailing spaces are ignored. If format is invalid returns zero.
func ParseDate(str string) (d Date, err error) {
func parseDate(str string) (d Date, err error) {
str = strings.TrimSpace(str)
if str == "0000-00-00" {
return