From 49e2070b69934fd997727b0d695a234c1e105175 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 30 Apr 2020 11:06:26 -0400 Subject: [PATCH] reduce scope a bit --- activity.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/activity.go b/activity.go index 02053a8..12c9cba 100644 --- a/activity.go +++ b/activity.go @@ -161,11 +161,9 @@ func savedonk(url string, name, desc, media string, localize bool) *Donk { if url == "" { return nil } - donk := finddonk(url) - if donk != nil { + if donk := finddonk(url); donk != nil { return donk } - donk = new(Donk) log.Printf("saving donk: %s", url) xid := xfiltrate() data := []byte{} @@ -217,6 +215,7 @@ saveit: log.Printf("error saving file %s: %s", url, err) return nil } + donk := new(Donk) donk.FileID = fileid donk.XID = xid return donk