Fix url variable location scope
This commit is contained in:
parent
72bd56e8d8
commit
211b41ecfc
2
main.go
2
main.go
|
@ -81,11 +81,11 @@ func save(raw []byte) []string {
|
||||||
sha := hash(p)
|
sha := hash(p)
|
||||||
query, err := db.Query("select id, hash, data, delkey from pastebin")
|
query, err := db.Query("select id, hash, data, delkey from pastebin")
|
||||||
for query.Next() {
|
for query.Next() {
|
||||||
url := ADDRESS + "/p/" + id
|
|
||||||
var id, hash, paste, delkey string
|
var id, hash, paste, delkey string
|
||||||
err := query.Scan(&id, &hash, &paste, &delkey)
|
err := query.Scan(&id, &hash, &paste, &delkey)
|
||||||
check(err)
|
check(err)
|
||||||
if hash == sha {
|
if hash == sha {
|
||||||
|
url := ADDRESS + "/p/" + id
|
||||||
return []string{id, hash, url, paste, delkey}
|
return []string{id, hash, url, paste, delkey}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue