Unused arguments was removed

This commit is contained in:
2016-07-23 16:34:15 +05:00
parent c0ef1ca769
commit fe380f7c01

View File

@@ -10,7 +10,7 @@ import (
"strconv" "strconv"
) )
func sendCommand(n *noolite.NooliteAdapter, command string, channel, value, r, g, b int) error { func sendCommand(command string, channel, value, r, g, b int) error {
if channel == -1 { if channel == -1 {
return errors.New("Channel was not set") return errors.New("Channel was not set")
} }
@@ -94,7 +94,7 @@ func main() {
flag.Parse() flag.Parse()
if *http_port < 0 { if *http_port < 0 {
err := sendCommand(n, *command, *channel, *value, *red, *green, *blue) err := sendCommand(*command, *channel, *value, *red, *green, *blue)
if err != nil { if err != nil {
panic(err) panic(err)
@@ -103,7 +103,7 @@ func main() {
http.HandleFunc("/noolite/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/noolite/", func(w http.ResponseWriter, r *http.Request) {
command, channel, value, red, green, blue := parseParams(r.URL.Path[1:]) command, channel, value, red, green, blue := parseParams(r.URL.Path[1:])
err := sendCommand(n, command, channel, value, red, green, blue) err := sendCommand(command, channel, value, red, green, blue)
if err != nil { if err != nil {
fmt.Fprintf(w, "{\"error\": %q}", err) fmt.Fprintf(w, "{\"error\": %q}", err)