kavea/src/common.go

32 lines
516 B
Go

package main
import (
"log"
"net/http"
)
func checkError(err error) bool {
if err != nil {
log.Print("ERROR! " + err.Error())
return false
}
return true
}
/* HTTP */
func checkWebError(w http.ResponseWriter, err error) bool {
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return false
}
return true
}
//func getURLParam(r *http.Request, param string) string {
// paramList, exists := r.URL.Query()[param]
// if !exists {
// return ""
// }
// return paramList[0]
//}