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()
|
defer stmt.Close()
|
||||||
|
|
||||||
var shortURL string
|
var shortURL string
|
||||||
err = stmt.QueryRow(url).Scan(&shortURL)
|
_ = stmt.QueryRow(url).Scan(&shortURL)
|
||||||
|
|
||||||
// If short url doesn't exist then create it
|
// If short url doesn't exist then create it
|
||||||
if len(shortURL) == 0 {
|
if len(shortURL) == 0 {
|
||||||
|
@ -114,7 +114,7 @@ func urlH(w http.ResponseWriter, r *http.Request) {
|
||||||
errChk(err)
|
errChk(err)
|
||||||
|
|
||||||
var url string
|
var url string
|
||||||
err = stmt.QueryRow(shortURL).Scan(&url)
|
_ = stmt.QueryRow(shortURL).Scan(&url)
|
||||||
|
|
||||||
if len(url) != 0 {
|
if len(url) != 0 {
|
||||||
http.Redirect(w, r, url, http.StatusSeeOther)
|
http.Redirect(w, r, url, http.StatusSeeOther)
|
||||||
|
|
Loading…
Reference in New Issue