diff options
Diffstat (limited to 'hswg/main.go')
-rw-r--r-- | hswg/main.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hswg/main.go b/hswg/main.go index 21ca569..82b3014 100644 --- a/hswg/main.go +++ b/hswg/main.go @@ -107,7 +107,11 @@ func Render(r io.Reader, config configuration.Configuration) ( var doc types.Document if doc, err = parser.ParseDocument(pr, config); err == nil { - for _, problem := range validator.Validate(&doc) { + problems, err := validator.Validate(&doc) + if err != nil { + fmt.Fprintln(os.Stderr, err) + } + for _, problem := range problems { fmt.Fprintln(os.Stderr, problem.Message) } ctx := renderer.NewContext(doc, config) @@ -140,7 +144,7 @@ type Entry struct { // Published returns the date when the entry was published, or nil if unknown. func (e *Entry) Published() *time.Time { - if d, ok := e.Metadata.Attributes.GetAsString("date"); !ok { + if d, _, err := e.Metadata.Attributes.GetAsString("date"); err != nil { return nil } else if t, err := time.Parse(time.RFC3339, d); err == nil { return &t |