This file contains hidden or 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
| type Student struct { | |
| Name string | |
| } |
This file contains hidden or 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
| `{{define "T1"}}ONE{{end}} | |
| {{define "T2"}}TWO{{end}} | |
| {{define "T3"}}{{template "T1"}} {{template "T2"}}{{end}} | |
| {{template "T3"}}` |
This file contains hidden or 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 main | |
| import ( | |
| "log" | |
| "os" | |
| "text/template" | |
| ) | |
| type Student struct { | |
| //exported field since it begins |
This file contains hidden or 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 main | |
| import ( | |
| "log" | |
| "os" | |
| "text/template" | |
| ) | |
| type Person struct { | |
| Name string |
This file contains hidden or 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 main | |
| import ( | |
| "log" | |
| "os" | |
| "text/template" | |
| ) | |
| type Person struct { | |
| Name string |
This file contains hidden or 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
| {{define "layout"}} | |
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>{{template "title"}}</title> | |
| <link rel="stylesheet" href="/public/stylesheets/dosasite.css"> | |
| </head> | |
| <body> |
This file contains hidden or 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
| {{define "title"}}Dosa Diner{{end}} | |
| {{define "body"}} | |
| <h1><img src="public/images/dosa.jpg" alt="Dosa Diner" />Dosa Diner</h1> | |
| <h2>The Restaurant</h2> | |
| <p>The Dosa Diner offers casual lunch and dinner fare in a hip atmosphere. | |
| The menu changes regularly to highlight the freshest ingredients.</p> | |
| <h2>Catering Services</h2> |
This file contains hidden or 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 main | |
| import ( | |
| "fmt" | |
| "html/template" | |
| "log" | |
| "net/http" | |
| "os" | |
| "path" | |
| ) |
This file contains hidden or 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
| // quoteKey returns the key used for all quote entries. | |
| func quoteKey(c context.Context) *datastore.Key { | |
| return datastore.NewKey(c, "Quote", "default_quote", 0, nil) | |
| } | |
| func quote(w http.ResponseWriter, r *http.Request) { | |
| c := appengine.NewContext(r) | |
| q1 := Quote{ | |
| Author: r.FormValue("aut"), | |
| Message: r.FormValue("quo"), |
This file contains hidden or 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 quote | |
| import ( | |
| "fmt" | |
| "html/template" | |
| "net/http" | |
| // Package context defines the Context type | |
| // Do not store Contexts inside a struct type; instead, pass a | |
| // Context explicitly to each function that needs it. The Context |