Fix conflicting messages
This commit is contained in:
parent
326f707056
commit
3686f74bcb
10
main.go
10
main.go
|
@ -70,13 +70,13 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
var s string
|
var s string
|
||||||
err = db.QueryRow("select data from pastebin where id=?", param1).Scan(&s)
|
err = db.QueryRow("select data from pastebin where id=?", param1).Scan(&s)
|
||||||
db.Close()
|
db.Close()
|
||||||
if err == sql.ErrNoRows {
|
check(err)
|
||||||
io.WriteString(w, "Error invalid paste")
|
|
||||||
} else {
|
|
||||||
check(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if param1 != "" {
|
if param1 != "" {
|
||||||
|
|
||||||
|
if err == sql.ErrNoRows {
|
||||||
|
io.WriteString(w, "Error invalid paste")
|
||||||
|
}
|
||||||
if param2 != "" {
|
if param2 != "" {
|
||||||
highlight := pygments.Highlight(html.UnescapeString(s), param2, "html", "full, style=autumn,linenos=True, lineanchors=True,anchorlinenos=True,", "utf-8")
|
highlight := pygments.Highlight(html.UnescapeString(s), param2, "html", "full, style=autumn,linenos=True, lineanchors=True,anchorlinenos=True,", "utf-8")
|
||||||
io.WriteString(w, highlight)
|
io.WriteString(w, highlight)
|
||||||
|
|
Loading…
Reference in New Issue