From 451f93977b16f14657e0c6c08ccc614fa3ac4f38 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Sun, 19 Jun 2016 16:50:56 +1000 Subject: [PATCH] Fix url variable location scope --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 626817b..c9a74f0 100644 --- a/main.go +++ b/main.go @@ -81,11 +81,11 @@ func save(raw []byte) []string { sha := hash(p) query, err := db.Query("select id, hash, data, delkey from pastebin") for query.Next() { - url := ADDRESS + "/p/" + id var id, hash, paste, delkey string err := query.Scan(&id, &hash, &paste, &delkey) check(err) if hash == sha { + url := ADDRESS + "/p/" + id return []string{id, hash, url, paste, delkey} } }