Skip to content

Commit b31ecae

Browse files
committed
Created Valid() function
1 parent 95f52f6 commit b31ecae

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

parse.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func parse(content string) (*SecurityTxt, error) {
7070
}
7171

7272
case "Expires":
73-
// Must be uppercase for 'z' -> 'Z' (RFC3339).
7473
t, err := time.Parse(time.RFC3339, strings.ToUpper(value))
7574
if err == nil {
7675
data.Expires = &t
@@ -114,3 +113,7 @@ func parse(content string) (*SecurityTxt, error) {
114113

115114
return data, nil
116115
}
116+
117+
func (s *SecurityTxt) Valid() bool {
118+
return len(s.Errors) == 0
119+
}

0 commit comments

Comments
 (0)