Created
September 17, 2018 17:47
-
-
Save DiegoSantosWS/71b0e6fc15604626547dc73aaae8a194 to your computer and use it in GitHub Desktop.
Carregando a index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import ( | |
"log" | |
"net/http" | |
ctr "github.com/DiegoSantosWS/gotoweb/example_html/renderHtml" | |
) | |
//IndexPage carrega template de index | |
func IndexPage(w http.ResponseWriter, r *http.Request) { | |
data := map[string]interface{}{ | |
"Title": "My frist page using GOLANG", | |
"Agre": "My frist page using GOLANG", | |
} | |
if err := ctr.ModelosIndex.ExecuteTemplate(w, "index.html", data); err != nil { | |
http.Error(w, "[CONTENT ERRO] Erro in the execute template", | |
http.StatusInternalServerError) | |
log.Fatal(err.Error()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment