From f1adae43370837959f35274dd55d49b5a9a09205 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 6 Sep 2019 08:20:45 +0900 Subject: [PATCH] Include a fast path to invalidate YearMonth --- arn/validate/Validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arn/validate/Validate.go b/arn/validate/Validate.go index 5d38d745..ffc633c4 100644 --- a/arn/validate/Validate.go +++ b/arn/validate/Validate.go @@ -60,7 +60,7 @@ func Date(date string) bool { // YearMonth tells you whether the date contain only the year and the month. func YearMonth(date string) bool { - if date == "" || strings.HasPrefix(date, "0001") { + if len(date) != len(YearMonthFormat) || strings.HasPrefix(date, "0001") { return false }