func tempHandler(w http.ResponseWriter, r *http.Request) {

	vars := mux.Vars(r)
	kelvinStr := vars["temp"]

	kelvin, err := strconv.ParseFloat(kelvinStr, 64)
	if err != nil {
		errResponse(w, err)
		return
	}

	fmt.Printf("running: %f\n", kelvin)

	celsius := kelvin - 273.15
	λ := 0.002898 / kelvin

	values := []string{
		prefix(kelvin, "K"),
		fmt.Sprintf("%e °C", celsius),
		prefix(λ, "m"),
	}

	w.Header().Add("Content-Type", "application/json")
	w.WriteHeader(http.StatusOK)

	json.NewEncoder(w).Encode(values)
}
// tempHandler decodes the path and returns an appropriate response.
tempHandler decodes the path and returns an appropriate response.
// tempHandler decodes the path and returns an appropriate response .
func tempHandler(w http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	kelvinStr := vars["temp"]
	kelvin, err := strconv.ParseFloat(kelvinStr, 64)
	if err != nil {
		errResponse(w, err)
		return
	}
	fmt.Printf("running: %f\n", kelvin)
	celsius := kelvin - 273.15
	λ := 0.002898 / kelvin
	values := []string{
		prefix(kelvin, "K"),
		fmt.Sprintf("%e °C", celsius),
		prefix(λ, "m"),
	}
	w.Header().Add("Content-Type", "application/json")
	w.WriteHeader(http.StatusOK)
	json.NewEncoder(w).Encode(values)
}
func tempHandler ( w http . ResponseWriter , r * http . Request ) { vars := mux . Vars ( r ) kelvinStr := vars [ " " ] kelvin , err := strconv . ParseFloat ( kelvinStr , 64 ) if err != nil { errResponse ( w , err ) return } fmt . Printf ( " \n " , kelvin ) celsius := kelvin - 273.15 λ  =  .002898  elvin values := [ ] string { prefix ( kelvin , " " ) , fmt . Sprintf ( " , elsius) , prefix ( λ, m ) , } w . Header ( ) . Add ( " " , " " ) w . WriteHeader ( http . StatusOK ) json . NewEncoder ( w ) . Encode ( values ) }
tempHandler decodes the path and returns an appropriate response.
tempHandler decodes the path and returns an appropriate response .