From 79eceb27d4bde606c36a986c9589ea01a967afe5 Mon Sep 17 00:00:00 2001 From: Eliot Whalan Date: Fri, 24 Jun 2016 17:11:49 +1000 Subject: [PATCH] Fix up array error --- main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 3a21631..9529b4b 100644 --- a/main.go +++ b/main.go @@ -88,14 +88,16 @@ func save(raw string, lang string, title string) []string { check(err) sha := hash(raw) - query, err := db.Query("select id, hash, data, delkey from pastebin") + query, err := db.Query("select id, title hash, data, delkey from pastebin") for query.Next() { - var id, hash, paste, delkey string - err := query.Scan(&id, &hash, &paste, &delkey) + var id, title, hash, paste, delkey string + err := query.Scan(&id, &title, &hash, &paste, &delkey) check(err) if hash == sha { url := ADDRESS + "/p/" + id - return []string{id, hash, url, paste, delkey} + if title == "" { + return []string{id, title, hash, url, paste, delkey} + } } } id := generateName()