Remove ineffectual assignment to err
This commit is contained in:
parent
63cec1ffdc
commit
5bd1a40cf1
4
main.go
4
main.go
|
@ -76,7 +76,7 @@ func sURLH(w http.ResponseWriter, r *http.Request) {
|
|||
defer stmt.Close()
|
||||
|
||||
var shortURL string
|
||||
err = stmt.QueryRow(url).Scan(&shortURL)
|
||||
_ = stmt.QueryRow(url).Scan(&shortURL)
|
||||
|
||||
// If short url doesn't exist then create it
|
||||
if len(shortURL) == 0 {
|
||||
|
@ -114,7 +114,7 @@ func urlH(w http.ResponseWriter, r *http.Request) {
|
|||
errChk(err)
|
||||
|
||||
var url string
|
||||
err = stmt.QueryRow(shortURL).Scan(&url)
|
||||
_ = stmt.QueryRow(shortURL).Scan(&url)
|
||||
|
||||
if len(url) != 0 {
|
||||
http.Redirect(w, r, url, http.StatusSeeOther)
|
||||
|
|
Loading…
Reference in New Issue