убрал конвертацию string в []byte в контроллере главной страницы, сделал запись в w http.ResponseWriter через fprintf
parent
cc3fe33474
commit
46ef8967b1
|
@ -1,6 +1,7 @@
|
|||
package controllers_pages
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"main/mvc/models"
|
||||
|
@ -70,7 +71,7 @@ func sendCount(w http.ResponseWriter, data []byte) {
|
|||
func sendLove(w http.ResponseWriter) {
|
||||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("13.01.2005\n"))
|
||||
fmt.Fprint(w, "13.01.2005\n")
|
||||
}
|
||||
|
||||
// Ответ на метод LIMINAL
|
||||
|
@ -78,6 +79,5 @@ func sendLiminal(w http.ResponseWriter) {
|
|||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
text := "If you're not careful and you slip out of reality in the wrong place, you'll end up in the Backstage, where there's nothing but the stench of old damp carpet, yellow-colored madness, the endless unbearable hum of fluorescent lights, and roughly six hundred million square miles of randomly arranged empty rooms.\n"
|
||||
w.Write([]byte(text))
|
||||
|
||||
fmt.Fprint(w, text)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue