diff --git a/config-main.go b/config-main.go index 207eeeff..d3257530 100644 --- a/config-main.go +++ b/config-main.go @@ -73,9 +73,8 @@ func (a AliasMessage) String() string { return message } jsonMessageBytes, e := json.Marshal(a) - if e != nil { - fatalIf(probe.NewError(e), "Unable to marshall into JSON.") - } + fatalIf(probe.NewError(e), "Unable to marshall into JSON.") + return string(jsonMessageBytes) } diff --git a/ls.go b/ls.go index 0fc97db4..625fa600 100644 --- a/ls.go +++ b/ls.go @@ -57,9 +57,8 @@ func (c ContentMessage) String() string { return message } jsonMessageBytes, e := json.Marshal(c) - if e != nil { - fatalIf(probe.NewError(e), "Unable to marshall into JSON.") - } + fatalIf(probe.NewError(e), "Unable to marshall into JSON.") + return string(jsonMessageBytes) } diff --git a/mirror-url.go b/mirror-url.go index 70b14189..93da2b8c 100644 --- a/mirror-url.go +++ b/mirror-url.go @@ -59,9 +59,8 @@ func (s MirrorMessage) String() string { return fmt.Sprintf("ā€˜%s’ -> ā€˜%s’", s.Source, s.Targets) } mirrorMessageBytes, e := json.Marshal(s) - if e != nil { - fatalIf(probe.NewError(e), "Unable to marshall into JSON.") - } + fatalIf(probe.NewError(e), "Unable to marshall into JSON.") + return string(mirrorMessageBytes) }