ribbit/helpers.go

23 lines
341 B
Go

package main
import (
"net/http"
)
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)
}