ribbit/helpers.go

23 lines
341 B
Go
Raw Normal View History

2018-04-26 11:53:03 +00:00
package main
import (
"net/http"
2018-04-26 11:53:03 +00:00
)
func addStringIfUnique(st string, sl []string) []string {
for i := range sl {
if sl[i] == st {
return sl
}
}
return append(sl, st)
}
func userError(w http.ResponseWriter) {
http.Error(w, "You did a bad", 400)
}
func serverError(w http.ResponseWriter) {
http.Error(w, "I did a bad", 500)
}