cmd/hello: style welcome message
@@ -78,7 +78,9 @@ func getTmpl() (*template.Template, error) {
type tmplData struct {
DisplayName string // "Foo Barberson"
LoginName string // "foo@bar.com"
+ ProfilePicURL string // "https://..."
MachineName string // "imac5k"
+ MachineOS string // "Linux"
IP string // "100.2.3.4"
}
@@ -114,7 +116,9 @@ func root(w http.ResponseWriter, r *http.Request) {
data = tmplData{
DisplayName: "Taily Scalerson",
LoginName: "taily@scaler.son",
+ ProfilePicURL: "https://placekitten.com/200/200",
MachineName: "scaled",
+ MachineOS: "Linux",
IP: "100.1.2.3",
}
} else {
@@ -126,7 +130,9 @@ func root(w http.ResponseWriter, r *http.Request) {
data = tmplData{
DisplayName: who.UserProfile.DisplayName,
LoginName: who.UserProfile.LoginName,
+ ProfilePicURL: who.UserProfile.ProfilePicURL,
MachineName: who.Node.ComputedName,
+ MachineOS: who.Node.Hostinfo.OS,
IP: ip,
}
}
