Fix url variable location scope

This commit is contained in:
Eliot Whalan 2016-06-19 16:50:56 +10:00
parent 72bd56e8d8
commit 211b41ecfc
No known key found for this signature in database
GPG Key ID: C0A42175139840D6
1 changed files with 1 additions and 1 deletions

View File

@ -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}
}
}