Skip to content

Instantly share code, notes, and snippets.

@DiegoSantosWS
Created September 17, 2018 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DiegoSantosWS/0a623e09ce04b2d7c2eb925c4af353a8 to your computer and use it in GitHub Desktop.
Save DiegoSantosWS/0a623e09ce04b2d7c2eb925c4af353a8 to your computer and use it in GitHub Desktop.
package models
import (
"log"
"net/http"
ctr "github.com/DiegoSantosWS/gotoweb/example_html/renderHtml"
)
//IndexPage carrega template de index
func ContactPage(w http.ResponseWriter, r *http.Request) {
data := map[string]interface{}{
"Title": "My frist page using GOLANG",
"Title2": "Enter in contact to more informations",
}
if err := ctr.ModelosContato.ExecuteTemplate(w, "contato.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