From ad25f4bcc3b3fa3adbf1f115c5cd3ce58eb1df9d Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Tue, 28 Jul 2015 21:43:02 +0100 Subject: [PATCH] Fixing build issues --- service_youtube.go | 4 ++-- web.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/service_youtube.go b/service_youtube.go index a831f09..9a94723 100644 --- a/service_youtube.go +++ b/service_youtube.go @@ -72,7 +72,7 @@ func (y YouTube) NewRequest(user *gumble.User, url string) (string, error) { playlist, err := NewYouTubePlaylist(user.Name, shortURL) return playlist.Title(), err } else { - return nil, errors.New("NO_PLAYLIST_PERMISSION") + return "", errors.New("NO_PLAYLIST_PERMISSION") } } else { re = RegexpFromURL(url, youtubeVideoPatterns) @@ -85,7 +85,7 @@ func (y YouTube) NewRequest(user *gumble.User, url string) (string, error) { return song.Title(), err } } else { - return nil, err + return "", err } } diff --git a/web.go b/web.go index cc392b2..28ae8cd 100644 --- a/web.go +++ b/web.go @@ -24,7 +24,7 @@ func Webserver() { func homepage(w http.ResponseWriter, r *http.Request) { var uname = token_client[r.FormValue("token")] - if uname == "" { + if uname == nil { fmt.Fprintf(w, "Invalid Token") } else { fmt.Fprintf(w, "Hang in there %s, I haven't made the website yet!", uname.Name) @@ -33,7 +33,7 @@ func homepage(w http.ResponseWriter, r *http.Request) { func addSong(w http.ResponseWriter, r *http.Request) { var uname = token_client[r.FormValue("token")] - if uname == "" { + if uname == nil { fmt.Fprintf(w, "Invalid Token") } else { var url = UnescapeString(r.FormValue("url")) @@ -43,11 +43,11 @@ func addSong(w http.ResponseWriter, r *http.Request) { func GetWebAddress(user *gumble.User) { if client_token[user] != "" { - token_client[client_token[user]] = "" + token_client[client_token[user]] = nil } // dealing with collisions var firstLoop = true - for firstLoop || token_client[client_token[user]] != "" { + for firstLoop || token_client[client_token[user]] != nil { client_token[user] = randSeq(10) firstLoop = false }