reportar error si no puede escuchar en puerto

This commit is contained in:
Cat /dev/Nulo 2023-01-19 21:58:58 -03:00
parent 4be58013b6
commit 51b7a806e2
2 changed files with 1 additions and 2 deletions

View file

@ -48,7 +48,7 @@ func main() {
http.HandleFunc("/", index) http.HandleFunc("/", index)
http.Handle("/cache/", &cache{db: db}) http.Handle("/cache/", &cache{db: db})
http.ListenAndServe(os.Args[1], nil) log.Fatal(http.ListenAndServe(os.Args[1], nil))
} }
func index(w http.ResponseWriter, req *http.Request) { func index(w http.ResponseWriter, req *http.Request) {

View file

@ -76,7 +76,6 @@ func (r *cache) ServeHTTP(w http.ResponseWriter, req *http.Request) {
if len(parts) != 2 { if len(parts) != 2 {
http.Error(w, "wrong amount of parts", http.StatusBadRequest) http.Error(w, "wrong amount of parts", http.StatusBadRequest)
return return
} }
name := parts[1] name := parts[1]