diff options
Diffstat (limited to 'cmd/cetus-bing/cetus-bing.go')
-rw-r--r-- | cmd/cetus-bing/cetus-bing.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/cmd/cetus-bing/cetus-bing.go b/cmd/cetus-bing/cetus-bing.go index 871c96a..b8c397c 100644 --- a/cmd/cetus-bing/cetus-bing.go +++ b/cmd/cetus-bing/cetus-bing.go @@ -4,7 +4,6 @@ import ( "encoding/json" "flag" "fmt" - "log" "math/rand" "time" @@ -60,7 +59,7 @@ func main() { bpod := bpod{} err = json.Unmarshal([]byte(body), &bpod) - errChk("body unmarshal failed", err) + cetus.ErrChk("body unmarshal failed", err) // if random was set then bpodRes holds list of multiple // responses, choose a random response from the list @@ -72,7 +71,7 @@ func main() { // correct date format dt, err := time.Parse("20060102", bpodPhoto.startDate) - errChk("bpodPhoto.startDate parse failed", err) + cetus.ErrChk("bpodPhoto.startDate parse failed", err) bpodPhoto.startDate = dt.Format("2006-01-02") printDetails(bpodPhoto) @@ -83,7 +82,7 @@ func main() { } err = background.Set(bpodPhoto.url) - errChk("setting background failed", err) + cetus.ErrChk("setting background failed", err) } func parseFlags() { @@ -126,8 +125,3 @@ func bpodBody() (string, error) { body, err := bing.GetBpodJson(reqInfo, t) return body, err } - -func errChk(ctx string, err error) { - log.Println(ctx) - log.Fatal(err) -} |