Fixing build issues

This commit is contained in:
MichaelOultram 2015-07-30 13:54:13 +01:00
parent 06ce580d27
commit eb8afc4404
3 changed files with 9 additions and 7 deletions

View file

@ -14,6 +14,7 @@ import (
"os"
"os/user"
"reflect"
"regexp"
"strings"
"time"

View file

@ -9,6 +9,7 @@ package main
import (
"errors"
"fmt"
"github.com/layeh/gumble/gumble"
)
@ -64,7 +65,7 @@ func findServiceAndAdd(user *gumble.User, url string) error {
}
if urlService == nil {
return "", errors.New("INVALID_URL")
return errors.New("INVALID_URL")
} else {
oldLength := dj.queue.Len()
var title string
@ -80,7 +81,7 @@ func findServiceAndAdd(user *gumble.User, url string) error {
} else {
dj.queue.CurrentSong().Delete()
dj.queue.OnSongFinished()
return "", errors.New("FAILED_TO_DOWNLOAD")
return errors.New("FAILED_TO_DOWNLOAD")
}
}
} else {

10
web.go
View file

@ -36,7 +36,7 @@ func Webserver(port int) *WebServer {
return &webserver
}
func (w WebServer) homepage(w http.ResponseWriter, r *http.Request) {
func (web WebServer) homepage(w http.ResponseWriter, r *http.Request) {
var uname = token_client[r.URL.Path[1:]]
if uname == nil {
fmt.Fprintf(w, "Invalid Token")
@ -46,7 +46,7 @@ func (w WebServer) homepage(w http.ResponseWriter, r *http.Request) {
}
}
func (w WebServer) add(w http.ResponseWriter, r *http.Request) {
func (web WebServer) add(w http.ResponseWriter, r *http.Request) {
var uname = token_client[r.FormValue("token")]
if uname == nil {
fmt.Fprintf(w, "Invalid Token")
@ -55,7 +55,7 @@ func (w WebServer) add(w http.ResponseWriter, r *http.Request) {
}
}
func (w WebServer) volume(w http.ResponseWriter, r *http.Request) {
func (web WebServer) volume(w http.ResponseWriter, r *http.Request) {
var uname = token_client[r.FormValue("token")]
if uname == nil {
fmt.Fprintf(w, "Invalid Token")
@ -65,7 +65,7 @@ func (w WebServer) volume(w http.ResponseWriter, r *http.Request) {
}
}
func (w WebServer) skip(w http.ResponseWriter, r *http.Request) {
func (web WebServer) skip(w http.ResponseWriter, r *http.Request) {
var uname = token_client[r.FormValue("token")]
if uname == nil {
fmt.Fprintf(w, "Invalid Token")
@ -75,7 +75,7 @@ func (w WebServer) skip(w http.ResponseWriter, r *http.Request) {
}
}
func (w WebServer) GetWebAddress(user *gumble.User) {
func (web WebServer) GetWebAddress(user *gumble.User) {
if client_token[user] != "" {
token_client[client_token[user]] = nil
}