V
V
v- death2015-08-14 17:09:45
go
v- death, 2015-08-14 17:09:45

Why is only the first element from map picked up?

package main

import (
    "html/template"
    "os"
)


func main() {
    t := template.New("Test Template")       // На что влияет имя в кавычках ?
    t, _ = t.Parse("hello {{.H}}! {{.HE}}")  // Почему подхватывает только первый елемент с карты?
    
    p:= map[string]string{
    "H": "Hydrogen",
    "He": "Helium",
    }
    
    t.Execute(os.Stdout, p)
}

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
v- deathi, 2015-08-14
@vGrabko99

The letter "e" is in the wrong case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question