panic after json marshal fails

Signed-off-by: Matthias Riegler <me@xvzf.tech>
pull/7254/head
Matthias Riegler 6 years ago
parent 6bf5f98744
commit 71e1b85139

@ -22,6 +22,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log"
"net/url" "net/url"
"os" "os"
"path" "path"
@ -276,6 +277,9 @@ func ResolveReferenceURL(baseURL, refURL string) (string, error) {
} }
func (e *Entry) String() string { func (e *Entry) String() string {
buf, _ := json.Marshal(e) buf, err := json.Marshal(e)
if err != nil {
log.Panic(err)
}
return string(buf) return string(buf)
} }

Loading…
Cancel
Save