March 2019
Intermediate to advanced
336 pages
9h 9m
English
The CRM web application is shown as follows, with various web paths handled. The CRM application code is shown in the following code. The Home function executes the Home template with the writer parameter and the customers array (crm_app.go):
//main package has examples shown// in Hands-On Data Structures and algorithms with Go bookpackage main// importing fmt,database/sql, net/http, text/template packageimport ( "fmt" "net/http" "text/template" "log")var template_html = template.Must(template.ParseGlob("templates/*"))// Home - execute Templatefunc Home(writer http.ResponseWriter, request *http.Request) { var customers []Customer customers = GetCustomers() log.Println(customers) template_html.ExecuteTemplate(writer,"Home",customers) ...Read now
Unlock full access